# Sync Mirror

Part of [Repositories](https://cursor.com/docs/api/origin/reference/repositories.md) in the Origin API reference.

POST

`/v1/origin/repos/{ownerSlug}/{repoName}:syncMirror`

Requires scope `repository:mirror:sync` (installation access token or user access token).

Synchronizes one ref of a mirrored repository from its upstream source. Returns HTTP `200` when the sync target is satisfied, or HTTP `202` when the sync is still pending. `wait=false` (the default) schedules the sync and usually returns `202`; it returns `200` immediately when `sha` is already reachable from `ref`. `wait=true` blocks until satisfied or the wait budget (\~2 minutes) expires; expiry still returns `202` and the sync continues in the background. Repositories that do not pull from an upstream source are rejected.

## Path Parameters

`ownerSlug` string Required

Owning entity's unique slug.

`repoName` string Required

Repo name, unique to the owner entity.

## Request Body

`ref` string Required

Full git ref name to fetch. Must start with `refs/` and name a ref after that prefix, for example `refs/heads/main` or `refs/tags/v1`. Short names such as `main` are rejected with `INVALID_ARGUMENT`.

`wait` boolean

When true, block until synced or the wait budget expires. Defaults to false.

`sha` string

Optional full commit object ID: 40- or 64-character hex. Omit or leave empty to wait on the tip of `ref`. When set and reachable from `ref`, the call returns early without waiting for other mirror work to drain. Other values are rejected with `INVALID_ARGUMENT`.

## Response Fields

`synced` boolean

True when the sync target is known to be satisfied, false while the sync is still pending. Always present, mirroring the HTTP status: `200` when true, `202` when false.

```bash
curl --request POST \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME:syncMirror' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "ref": "refs/heads/main",
  "wait": true
}'
```

**Response shape:**

```json
{
  "synced": true
}
```

The mirror-transition endpoints are documented on the [Origin Migration API](https://cursor.com/docs/api/origin/migrations.md). [Sync Mirror](https://cursor.com/docs/api/origin/reference/sync-mirror.md) stays on this page.


---

## Sitemap

[Origin API docs index](https://cursor.com/docs/api/origin/llms.txt)
