> This page is for Workspace app.

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

# List a work session’s turns

GET https://api.cloudraker.com/workspace/sessions/{sessionId}/turns

Every turn the session has run, newest state included — the HTTP counterpart of the turn frames the live socket pushes, so a client that missed a frame reads the truth here instead of guessing. Pages: `limit` is 1-200 (default 50) and `starting_after` takes the previous page’s last id; `hasMore` says whether another page follows (RKO-761 R9C-07). **Authorization:** `work_session:read` on the session, OR `space:contribute` on one of its linked spaces; a desk session is readable only by its owner. Any denial is 404. A read-only caller reads the SANITIZED view, the same one its live socket gets.

Reference: https://docs.cloudraker.com/workspace/api/workspace-sessions/list-workspace-session-turns

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `sessionId` (string, required)

### Query parameters

- `limit` (integer, optional) — Page size, 1-200 (default 50). Enforced: a bad value is 400 `validation_failed`.
- `starting_after` (string, optional) — The previous page’s last id.

## Response

### 200

The session’s turns.

- `data` (list of WorkSessionTurn, required)
- `hasMore` (boolean, required)

## Errors

### 400 Bad Request Error

`validation_failed` — a bad `limit` or `starting_after`.

- `any`

### 404 Not Found Error

No such session, or the caller may not see it.

- `any`

## Types

### WorkSessionTurn

- `id` (string, required)
- `sessionId` (string, required)
- `agentId` (string, required)
- `agentVersionId` (string, required)
- `harness` (enum, required)
  - Allowed values: `native`, `sandbox`
- `status` (enum, required)
  - Allowed values: `running`, `waiting_approval`, `waiting_action`, `waiting_user`, `paused`, `completed`, `failed`, `cancelled`
- `startedBy` (WorkSessionSender, required)
- `reason` (enum, required)
  - Allowed values: `mention`, `trigger`, `handoff`, `steer`, `assistant`
- `threadId` (string, required, nullable)
- `parentTurnId` (string, required, nullable)
- `nativeRunId` (string, required, nullable)
- `nativeSpaceId` (string, required, nullable)
- `sandboxId` (string, required, nullable)
- `startedAt` (datetime, required)
- `finishedAt` (string, required, nullable)
- `summary` (string, required, nullable)
- `error` (string, required, nullable)
- `outcome` ("incomplete", optional, nullable)
- `waitingReason` (enum, optional, nullable)
  - Allowed values: `sandbox_capacity`, `sandbox_provisioning`, `budget_exceeded`
- `fileIds` (list of string, optional)

### WorkSessionSender

- `kind` (enum, required)
  - Allowed values: `user`, `agent`, `api_key`, `trigger`, `external`
- `id` (string, required)
- `name` (string, required)
- `avatarUrl` (string, optional)
- `source` (enum, optional)
  - Allowed values: `web`, `desktop`, `api`, `email`, `webhook`, `schedule`, `slack`, `assistant`, `manual`, `trigger`

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "string",
      "sessionId": "string",
      "agentId": "string",
      "agentVersionId": "string",
      "harness": "native",
      "status": "running",
      "startedBy": {
        "kind": "user",
        "id": "string",
        "name": "string",
        "avatarUrl": "string",
        "source": "web"
      },
      "reason": "mention",
      "threadId": "string",
      "parentTurnId": "string",
      "nativeRunId": "string",
      "nativeSpaceId": "string",
      "sandboxId": "string",
      "startedAt": "2024-01-15T09:30:00Z",
      "finishedAt": "string",
      "summary": "string",
      "error": "string",
      "outcome": "string",
      "waitingReason": "sandbox_capacity",
      "fileIds": [
        "string"
      ]
    }
  ],
  "hasMore": true
}
```

**SDK Code**

```python
import requests

url = "https://api.cloudraker.com/workspace/sessions/sessionId/turns"

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

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

print(response.json())
```

```javascript
const url = 'https://api.cloudraker.com/workspace/sessions/sessionId/turns';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.cloudraker.com/workspace/sessions/sessionId/turns"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	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/workspace/sessions/sessionId/turns")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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.get("https://api.cloudraker.com/workspace/sessions/sessionId/turns")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.cloudraker.com/workspace/sessions/sessionId/turns', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/workspace/sessions/sessionId/turns");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cloudraker.com/workspace/sessions/sessionId/turns")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```