---
title: "Get Sync Chat Context"
method: GET
path: "/agent-loop/sync-chat/context"
tags: ["sync-chat"]
---

# Get Sync Chat Context

`GET /agent-loop/sync-chat/context`

Per-user corpus-digest context for a sync-chat turn (agent-service-facing).

Authed by the sync-chat-turn JWT. The JWT's user_id scopes the entire
response; request inputs cannot widen it. Returns:
  - corpus digest: the user's scott-push sessions from the last 14 days
    with stats and key messages, recency-ordered (newest first, limit 30)
  - GitHub install state: so the assistant knows whether to nudge
  - thread ancestry: root to from_turn_id (same as review-chat context)

## Query parameters

- `from_turn_id` string, nullable

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- SyncChatContextResponse — Per-user context for a sync-chat turn: corpus digest, GitHub install state, usable connected sources, and this user's thread ancestry.
  - `digest` SyncChatDigestSession[], required
    - `workspace_id` string, required
    - `name` string, required
    - `description` string, nullable
    - `stats` unknown
    - `git_remote` string, nullable
    - `git_branch` string, nullable
    - `captured_at` string, date-time, required
    - `key_messages` string[]
  - `github_installs` SyncChatGitHubInstall[], required
    - `installation_id` integer, required
    - `account_login` string, nullable
  - `connected_sources` ConnectedSource[]
    - `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` SyncChatContextTurn[], required
    - `id` string, required
    - `parent_id` string, nullable, required
    - `user_id` string, nullable
    - `user_message` string, nullable, required
    - `assistant_text` string, nullable, required
    - `message_deltas` unknown
    - `usage` unknown

## Other responses

- `422` — Validation Error

---

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