> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenrip.com/llms.txt
> Use this file to discover all available pages before exploring further.

# View Context

> GET /v0/workspaces/:id/sessions/:sessionId/view — The saved context of the browser tab paired to this session

Reads what the operator's browser tab paired to this session is showing, so the harness can resolve "this document" before writing. Only saved identifiers are published: never draft text, selection, or keystrokes. The operator pairs a tab by opening the session's `browserLink` from [Load](/api-reference/workspaces/load). MCP: `workspace_view_context`. CLI: `rip workspace view context <workspace-id> <session-id>`.

**Auth:** `Authorization: Bearer tr_...` (an account API key). `{id}` and `{sessionId}` are UUIDs.

## Response

```json theme={null}
{
  "ok": true,
  "data": {
    "state": "paired",
    "view": {
      "id": "…", "workspaceId": "…", "accountId": "rip1…", "tabId": "…",
      "savedArtifactId": "<public id>", "savedVersionId": "…", "savedRevision": 7,
      "dirty": false, "following": true, "contextGeneration": 12,
      "heartbeatAt": "2026-09-15T09:00:00.000Z",
      "pairedSessionId": "3e4f…", "pairGeneration": 1,
      "navigation": {
        "operationId": "…", "artifactId": "<public id>", "expectedContextGeneration": 11,
        "navigationGeneration": 3, "status": "applied",
        "receipt": { "operationId": "…", "navigationGeneration": 3, "pairGeneration": 1, "expectedContextGeneration": 11, "status": "applied", "artifactId": "<public id>" }
      }
    },
    "navigation": { "…": "same as view.navigation" }
  }
}
```

| Field | Description |
| - | - |
| `state` | `paired`, or `disconnected` (then `view` and `navigation` are `null`) |
| `savedArtifactId` | Public id of the artifact the tab shows, or `null` |
| `savedVersionId` | The version the tab shows. Pass it as `expectedVersionId` when [publishing a version](/api-reference/versions/publish) |
| `savedRevision` | The artifact's workspace revision the tab shows. Pass it as `expectedWorkspaceRevision` on writes that take one |
| `dirty` / `following` | The person has unsaved edits / the tab follows navigation requests |
| `contextGeneration` | Increments whenever the saved context changes. [View Open](/api-reference/workspaces/view-open) takes it as `expectedContextGeneration` |
| `navigation` | The latest navigation request and its receipt, or `null` |

Write by `savedArtifactId` with those preconditions; the service never picks a write target from browser focus. If the session is not yours, has ended, expired, or been revoked, or the workspace is archived, the response is `state: "disconnected"` rather than an error, and nothing changes.
