---
title: "Get Workspace Context"
method: GET
path: "/agent-loop/workspaces/{workspace_id}/context"
tags: ["agent-loop"]
---

# Get Workspace Context

`GET /agent-loop/workspaces/{workspace_id}/context`

Walk parent_id chain and optionally bind the response to one document node.

## Path parameters

- `workspace_id` string, required

## Query parameters

- `from_turn_id` string, nullable
- `snapshot_id` string, nullable

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- WorkspaceSnapshotResponse
  - `workspace` WorkspaceConfig, required — Agent-service hydration. Used in WorkspaceSnapshotResponse only.
    - `id` string, required
    - `name` string, required
    - `created_at` string, date-time, required
    - `description` string, nullable
    - `model` string, nullable
    - `system_prompt` string, nullable
    - `connected_sources` ConnectedSource[], nullable
      - `id` string, nullable
      - `linked_by_user_id` string, required
      - `adapter` 'github' | 'slack' | 'uploaded_file', required — Type of source adapter (github, uploaded_file, etc.)
      - `visibility` 'private' | 'public' — Visibility level of a source
      - `config` union, required
        - GitHubSourceConfig — Configuration for a GitHub source
          - `repo` string, required
          - `branch` string, required
        - SlackSourceConfig — Configuration for a Slack source
          - `slack_team_id` string, required
          - `channel_id` string, required
        - UploadedFileSourceConfig — Configuration for an uploaded file source
          - `file_id` string, required
      - `metadata` union, required
        - GitHubSourceMetadata — Metadata for a GitHub source
          - `installation_id` integer, required
          - `commit_sha` string, required
        - SlackSourceMetadata — Metadata for a Slack source
          - `team_name` string, nullable
          - `channel_name` string, required
          - `is_private` boolean
        - UploadedFileSourceMetadata — Metadata for an uploaded file source
          - `filename` string, required
          - `content_type` string, nullable
          - `size_bytes` integer, nullable
    - `connected_sources_fingerprint` string, nullable
  - `turns` Turn[], required
    - `id` string, required
    - `workspace_id` string, required
    - `parent_id` string, nullable, required
    - `status` string, required
    - `is_from_scott_push` boolean
    - `user_message` string, nullable, required
    - `assistant_text` string, nullable, required
    - `error` string, nullable
    - `created_at` string, date-time, required
    - `completed_at` string, date-time, nullable, required
    - `user_id` string, nullable
    - `user_display_name` string, nullable
    - `tool_calls` unknown
    - `message_deltas` unknown
    - `usage` unknown
  - `selected_snapshot` SnapshotNode
    - `id` string, required
    - `document_artifact_id` string, required
    - `parent_snapshot_id` string, nullable
    - `turn_id` string, required
    - `kind` 'node' | 'capture', required
    - `status` 'draft' | 'committed' | 'discarded', required
    - `name` string, nullable
    - `created_at` string, date-time, required
    - `content` ArtifactContent, required — Blocks + markdown to render. Selection rule lives in `_build_artifact_summaries` (cursor-scoped latest capture, else creation node).
      - `blocks` unknown[], required
        - unknown
      - `markdown` string, required
    - `diff` ChangeEntry[], nullable
      - `changeType` 'added' | 'modified' | 'removed', required
      - `concept` string, required
      - `summary` string, required
      - `sectionHeading` string, nullable
    - `has_user_edits` boolean
    - `suggestion` Suggestion — An unresolved agent suggestion sitting on a draft snapshot. An agent turn writes this onto the focused draft instead of committing a node; the human resolves it (accept/reject) before committing. One per draft, last writer wins. The draft's own `content` excludes it.
      - `suggestion_id` string, required
      - `turn_id` string, required
      - `author` string, nullable
      - `base_markdown` string, required
      - `suggested_markdown` string, required
      - `suggested_blocks` unknown[]
        - unknown
  - `comments` CommentSnapshot[]
    - `id` string, required
    - `parent_id` string, nullable
    - `author_display_name` string, nullable
    - `content` string, required
    - `anchor_text` string, nullable
    - `resolved` boolean, required
    - `created_at` string, date-time, required
  - `artifacts` ArtifactSummary[]
    - `id` string, required
    - `workspace_id` string, required
    - `name` string, nullable
    - `produced_at_turn_id` string, required
    - `created_at` string, date-time, required
    - `content` ArtifactContent, required — Blocks + markdown to render. Selection rule lives in `_build_artifact_summaries` (cursor-scoped latest capture, else creation node).
      - `blocks` unknown[], required
        - unknown
      - `markdown` string, required
    - `diff` ChangeEntry[], nullable
      - `changeType` 'added' | 'modified' | 'removed', required
      - `concept` string, required
      - `summary` string, required
      - `sectionHeading` string, nullable
  - `commit_references` CommitReferenceSummary[]
    - `id` string, required
    - `workspace_id` string, required
    - `produced_at_turn_id` string, required
    - `repo` string, required
    - `branch` string, nullable
    - `commit_sha` string, required
    - `short_sha` string, required
    - `commit_title` string, required
    - `commit_message` string, required
    - `commit_url` string, required
    - `author_name` string, nullable
    - `author_email` string, nullable
    - `committed_at` string, date-time, required
    - `files_changed` integer, nullable
    - `additions` integer, nullable
    - `deletions` integer, nullable
    - `created_at` string, date-time, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/tryscott/apis/one-shot-api.md) · [All operations](https://skmtc.net/tryscott/apis/one-shot-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tryscott/one-shot-api/versions/28bdface01df/schema)
