---
title: "Sync Chat Connected Source Retrieval Details"
method: POST
path: "/agent-loop/sync-chat/connected-sources/retrieval-details"
tags: ["sync-chat"]
---

# Sync Chat Connected Source Retrieval Details

`POST /agent-loop/sync-chat/connected-sources/retrieval-details`

Mint clone + token retrieval details for a sync-chat connected source.

The agent holds the in-memory ConnectedSource from /context and posts it
back here to clone the repo mid-turn. Re-resolving from its config/metadata
only mints a token for a repo the user's own install already reaches, so no
persistence or workspace coupling is required (sync-chat is per-user).

## Headers

- `authorization` string, nullable

## Request body

- 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

## Response `200`

Successful Response

- RetrievalResult — Result of retrieving a source (how to actually fetch it)
  - `adapter` 'github' | 'slack' | 'uploaded_file', required — Type of source adapter (github, uploaded_file, etc.)
  - `retrieval` union, required
    - GitRetrievalDetails — Details for retrieving source via git clone
      - `kind` 'git' | 'file' — Kind of retrieval method (git clone, file download, etc.)
      - `clone_url` string, required
      - `token` string, required
      - `repo` string, required
      - `branch` string, required
      - `commit_sha` string, required
    - FileRetrievalDetails — Details for retrieving source via file download
      - `kind` 'git' | 'file' — Kind of retrieval method (git clone, file download, etc.)
      - `download_url` string, required
      - `filename` string, required
      - `content_type` string, nullable
      - `size_bytes` integer, nullable

## 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)
