Sync a ref against its upstream VCS branch
POST/api/v1/projects/:project_id/sync
Fetch-on-demand sync. VCS-source projects only.
Resolves the ref's tracked branch to its upstream HEAD sha; when it
matches the ref head's recorded commit the sync is a no-op
(unchanged, no download). Otherwise the archive is downloaded,
normalized, content-addressed and appended, and the ref advances
(synced). Provider calls retry transient failures with bounded
backoff and fail fast on permanent ones.
- Scope required:
projects:manage_source+ manager-or-above. - Archived projects reject the sync (409).
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
- 500
Successful Response
Bad request — malformed input or failed validation.
Missing, expired, or invalid credentials.
Authenticated but not authorized for this resource. Note: cross-organization reads return 404, not 403.
Resource not found, or hidden for tenant-enumeration safety (the caller lacks permission to know whether the resource exists).
Conflict — the current resource state does not allow this operation (e.g. assessment already started, email already in use).
Semantic validation failure — request shape was valid but contents were not.
Too many requests — rate limited. Retry after the window resets.
Internal server error — unexpected failure.