---
title: "Start a repository sync for a connection"
method: POST
path: "/git-connections/{connection_id}/sync"
tags: ["Git Providers"]
---

# Start a repository sync for a connection

`POST /git-connections/{connection_id}/sync`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/git-connections/{connection_id}/sync`
- Auth: HTTP bearer

Kicks off a background sync of the connection's repositories from the
provider. Returns `202 Accepted` immediately — the caller should poll
the connection endpoint for `syncing` / `synced_repository_count`
updates rather than waiting on this response. The sync is guarded by
a hard deadline and always releases the `syncing` flag on exit, so a
client that disconnects mid-sync will not leave the connection stuck.

## Path parameters

- `connection_id` integer, required

## Response `202`

Repository sync started in background

- RepositorySyncStartedResponse: Returned by `POST /git-connections/{id}/sync` to acknowledge that a sync has been kicked off in the background. Clients should poll the connection's `syncing` and `synced_repository_count` fields to track progress rather than waiting on this response.
  - `connection_id` integer, required
  - `started_at` string, date-time, required
  - `syncing` boolean, required

## Other responses

- `401`: Unauthorized
- `404`: Connection not found
- `409`: Sync already in progress
- `500`: Internal server error

## Changes

- **2026-05-30** `b72341d12f63`: 1 breaking, 1 info
  - removed the success response with the status `200`
  - added the success response with the status `202`
- **2026-04-25** `774be20905f2`: 1 info
  - added the optional property `repositories/items/preset/items/composeFiles` to the response with the `200` status

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/git-connections/:connection_id/sync/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
