Skip to main content
Triggers a sync from the configured upstream repository (e.g., GitHub) for repositories with GitHub sync enabled.
POST /api/v1/repos/pull-upstream
Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: application/json

{
  "ref": "main",      // Optional: specific ref to sync
  "after": "abc123"   // Optional: sync commits after this SHA
}

Request Body

ParameterTypeDescription
refOptionalSpecific ref to sync from upstream
afterOptionalOnly sync commits after this SHA

JWT Requirements

  • The JWT must include the repository in the repo claim
  • Requires git:write scope

Response

{
  "message": "Repository sync initiated successfully"
}

Notes

  • Returns 202 Accepted - sync is initiated asynchronously
  • Only works for repositories that have an upstream configured via base_repo during creation
  • See GitHub Sync guide for setup details
  • The SDK provides repo.pullUpstream() for this operation

Error Responses

StatusDescription
403 ForbiddenInvalid JWT or missing git:write scope
404 Not FoundRepository doesn’t exist
400 Bad RequestRepository has no upstream configured
500 Internal Server ErrorSync service unavailable