---
title: "Sync Registry Repository"
method: POST
path: "/registry/repos/{repository_id}/sync"
tags: ["registry-repositories"]
---

# Sync Registry Repository

`POST /registry/repos/{repository_id}/sync`

## Request

- Base URL: `https://platform.tracecat.com/api`
- URL: `https://platform.tracecat.com/api/registry/repos/{repository_id}/sync`
- Auth: one of:
  - API key in cookie `fastapiusersauth`
  - HTTP bearer

Sync an org-scoped registry repository.

For platform registries (base registry), use the admin API at /admin/registry/sync.

Args:
    repository_id: The ID of the repository to sync
    sync_params: Optional sync parameters, including target commit SHA and force flag

Raises:
    422: If there is an error syncing the repository (validation error)
    404: If the repository is not found
    400: If there is an error syncing the repository

## Path parameters

- `repository_id` string, uuid, required

## Request body

- RegistryRepositorySync: Parameters for syncing a repository to a specific commit.
  - `target_commit_sha` string, nullable: The specific commit SHA to sync to. If None, syncs to HEAD.
  - `force` boolean: Force sync by deleting the existing version first, allowing re-sync.

## Response `200`

Successful Response

- TracecatRegistryRepositoriesSchemasRegistrySyncResponse: Response model for registry sync operation.
  - `success` boolean, required
  - `repository_id` string, uuid, required
  - `origin` string, required
  - `version` string, nullable
  - `commit_sha` string, nullable
  - `actions_count` integer, nullable
  - `forced` boolean

## Other responses

- `400`: Cannot sync repository
- `404`: Registry repository not found
- `422`: Registry sync validation error

---

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