---
title: "Create Sync"
method: POST
path: "/api/folders/{library_id}/syncs"
tags: ["library-syncs"]
---

# Create Sync

`POST /api/folders/{library_id}/syncs`

## Request

- Base URL: `https://app.thinqos.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.thinqos.com/api/folders/{library_id}/syncs`
- Auth: none declared

Create a sync. A GitHub-out sync writes nothing until its first-sync
preview is confirmed with ``/start``; a website sync is watched at once;
a Google import runs first on the next sweep, or with Sync now.

## Path parameters

- `library_id` string, uuid, required

## Headers

- `x-impersonate-identity-id` string, nullable

## Request body

- CreateSyncIn: A new sync. ``kind`` picks which group of fields applies. ``github_folder`` needs ``installation_instance_id``, ``owner`` and ``name``. ``google_drive_folder`` needs ``instance_id`` (the caller's own Google Drive connection) and ``resource_id`` (the Drive folder id, from ``/google/folders``). ``website`` needs ``url``; its range checks (source kind, mode, destination, discovery, depth, caps) and the SSRF guard run in ``register_source`` and answer 422 with the guard's own message, so a refused URL says why.
  - `kind` 'github_folder' | 'website' | 'google_drive_folder'
  - `interval_seconds` integer, nullable
  - `installation_instance_id` string, uuid, nullable
  - `owner` string, nullable
  - `name` string, nullable
  - `branch` string
  - `path` string
  - `auto_merge` boolean
  - `on_remove` 'leave' | 'remove'
  - `write_note` boolean
  - `url` string, nullable
  - `source_kind` string
  - `mode` string
  - `destination` string
  - `discovery` string
  - `crawl_depth` integer
  - `path_prefix` string, nullable
  - `max_pages` integer
  - `max_bytes` integer
  - `instance_id` string, uuid, nullable
  - `resource_id` string, nullable
  - `resource_name` string
  - `arrive_published` boolean

## Response `201`

Successful Response

- SyncOut
  - `id` string, uuid, required
  - `library_id` string, uuid, required
  - `kind` string, required
  - `direction` string, required
  - `state` string, required
  - `target` SyncTarget, required
    - `owner` string, required
    - `name` string, required
    - `branch` string, required
    - `path` string, required
  - `website` WebsiteOut, required: A website sync's settings and sweep state (the former web source).
    - `url` string, required
    - `source_kind` string, required
    - `mode` string, required
    - `destination` string, required
    - `vouched` boolean, required
    - `discovery` string, required
    - `crawl_depth` integer, required
    - `path_prefix` string, nullable, required
    - `max_pages` integer, required
    - `max_bytes` integer, required
    - `effective_interval_seconds` integer, required
    - `quiet_sweeps` integer, required
    - `watched_urls` integer, required
    - `coverage` CoverageSummaryOut, required: What a website's last sweep found (TOS-5067), for the sync list. ``status`` is ``ok`` only when reconciliation actually ran that sweep, never merely because the fetch worked; see ``web_source_coverage._status``.
      - `status` string, required
      - `swept_at` string, date-time, nullable, required
      - `discovered` integer, required
      - `indexed` integer, required
      - `unchanged` integer, required
      - `skipped` integer, required
      - `failed` integer, required
  - `google` GoogleSyncOut: A Google import's settings: which connection, which resource.
    - `product` string, required
    - `instance_id` string, uuid, required
    - `connection_label` string, nullable, required
    - `icon_url` string, required
    - `resource_id` string, required
    - `resource_name` string, required
    - `arrive_published` boolean, required
  - `interval_seconds` integer, required
  - `auto_merge` boolean, required
  - `on_remove` string, required
  - `write_note` boolean, required
  - `last_run_at` string, date-time, nullable, required
  - `last_success_at` string, date-time, nullable, required
  - `last_status` string, nullable, required
  - `last_error` string, nullable, required
  - `counts` object, required
  - `pr_number` integer, nullable, required
  - `pr_url` string, nullable, required
  - `pr_state` string, nullable, required
  - `sync_branch` string, nullable, required
  - `created_by_identity_id` string, uuid, required
  - `mind_training` MindTrainingSummary: What a PATCH's synchronous training trigger actually did (TOS-5207 item 7). Without this, a PATCH that turns a website owned+mind returns 200 whether every document trained, all of them were blocked (e.g. the caller administers the folder but does not own the target agent), or nothing qualified at all.
    - `attempted` integer, required
    - `trained` integer, required
    - `blocked` integer, required
    - `other` integer, required
    - `reasons` string[], required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/thinqos/apis/thinqos-api.md) · [All operations](https://skmtc.dev/thinqos/apis/thinqos-api/llms.txt) · [OpenAPI document](https://skmtc.dev/thinqos/apis/thinqos-api/revisions/ce2c2ce318b1?raw)
