---
title: "List a work session’s turns"
---

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

# List a work session’s turns

Path: CloudRaker Workspace API › Workspace Sessions

`GET /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. **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.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `sessionId` (`listWorkspaceSessionTurns.path.sessionId`; string, required)

## Query parameters

- `limit` (`listWorkspaceSessionTurns.query.limit`; integer, optional) — Page size, 1-200 (default 50). Enforced: a bad value is 400 `validation_failed`.
  - min 1; max 200; example `50`
- `starting_after` (`listWorkspaceSessionTurns.query.starting_after`; string, optional) — The previous page’s last id.
  - minLength 1; maxLength 128

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.cloudraker.com/workspace/sessions/<sessionId>/turns' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

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

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

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

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

print(response.text)
```

## Responses

### 200

The session’s turns.

#### Example

```json
{
  "data": [
    {
      "id": "string",
      "sessionId": "string",
      "agentId": "string",
      "agentVersionId": "string",
      "harness": "native",
      "outcome": "incomplete",
      "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",
      "waitingReason": "sandbox_capacity",
      "fileIds": [
        "string"
      ],
      "startedAt": "2019-08-24T14:15:22Z",
      "finishedAt": "string",
      "summary": "string",
      "error": "string"
    }
  ],
  "hasMore": true
}
```

- `data` (`listWorkspaceSessionTurns.response.200.data`; array<object>, required)
  - `id` (`listWorkspaceSessionTurns.response.200.data.id`; string, required)
  - `sessionId` (`listWorkspaceSessionTurns.response.200.data.sessionId`; string, required)
    - minLength 1; maxLength 128
  - `agentId` (`listWorkspaceSessionTurns.response.200.data.agentId`; string, required)
  - `agentVersionId` (`listWorkspaceSessionTurns.response.200.data.agentVersionId`; string, required)
  - `harness` (`listWorkspaceSessionTurns.response.200.data.harness`; string, required)
    - one of `"native"`, `"sandbox"`
  - `status` (`listWorkspaceSessionTurns.response.200.data.status`; string, required)
    - one of `"running"`, `"waiting_approval"`, `"waiting_action"`, `"waiting_user"`, `"paused"`, `"completed"`, `"failed"`, `"cancelled"`
  - `startedBy` (`listWorkspaceSessionTurns.response.200.data.startedBy`; object, required)
    - `kind` (`listWorkspaceSessionTurns.response.200.data.startedBy.kind`; string, required)
      - one of `"user"`, `"agent"`, `"api_key"`, `"trigger"`, `"external"`
    - `id` (`listWorkspaceSessionTurns.response.200.data.startedBy.id`; string, required)
      - minLength 1; maxLength 128
    - `name` (`listWorkspaceSessionTurns.response.200.data.startedBy.name`; string, required)
      - minLength 1; maxLength 120
    - `avatarUrl` (`listWorkspaceSessionTurns.response.200.data.startedBy.avatarUrl`; string, optional)
      - maxLength 2048
    - `source` (`listWorkspaceSessionTurns.response.200.data.startedBy.source`; string, optional)
      - one of `"web"`, `"desktop"`, `"api"`, `"email"`, `"webhook"`, `"schedule"`, `"slack"`, `"assistant"`, `"manual"`, `"trigger"`
  - `reason` (`listWorkspaceSessionTurns.response.200.data.reason`; string, required)
    - one of `"mention"`, `"trigger"`, `"handoff"`, `"steer"`, `"assistant"`
  - `threadId` (`listWorkspaceSessionTurns.response.200.data.threadId`; string | null, required)
  - `parentTurnId` (`listWorkspaceSessionTurns.response.200.data.parentTurnId`; string | null, required)
  - `nativeRunId` (`listWorkspaceSessionTurns.response.200.data.nativeRunId`; string | null, required)
  - `nativeSpaceId` (`listWorkspaceSessionTurns.response.200.data.nativeSpaceId`; string | null, required)
  - `sandboxId` (`listWorkspaceSessionTurns.response.200.data.sandboxId`; string | null, required)
  - `startedAt` (`listWorkspaceSessionTurns.response.200.data.startedAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
  - `finishedAt` (`listWorkspaceSessionTurns.response.200.data.finishedAt`; string | null, required)
  - `summary` (`listWorkspaceSessionTurns.response.200.data.summary`; string | null, required)
  - `error` (`listWorkspaceSessionTurns.response.200.data.error`; string | null, required)
  - `outcome` (`listWorkspaceSessionTurns.response.200.data.outcome`; any of, optional)
    - any of: `string`, `null`
  - `waitingReason` (`listWorkspaceSessionTurns.response.200.data.waitingReason`; any of, optional)
    - any of:
      - `string`: one of `"sandbox_capacity"`, `"sandbox_provisioning"`, `"budget_exceeded"`
      - `null`
  - `fileIds` (`listWorkspaceSessionTurns.response.200.data.fileIds`; array<string>, optional)
- `hasMore` (`listWorkspaceSessionTurns.response.200.hasMore`; boolean, required)

### 400

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

### 404

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


Source: https://docs.cloudraker.com/workspace/api/workspace-sessions/list-workspace-session-turns/index.md
