repo claim (not the request body).
Basic Usage
With GitHub Sync
With Forking
Fork from an existing Code Storage repository:Request Body
| Parameter | Type | Description |
|---|---|---|
default_branch | Optional | Default branch name for the Code Storage repository (defaults to “main”) |
base_repo | Optional | Configuration for GitHub sync or forking (see below) |
BaseRepo for GitHub Sync
| Property | Type | Description |
|---|---|---|
provider | Required | Set to "github" |
owner | Required | GitHub organization or username |
name | Required | GitHub repository name |
default_branch | Optional | GitHub repository’s default branch |
BaseRepo for Forking
| Property | Type | Description |
|---|---|---|
provider | Required | Set to "code" or "code.storage" |
owner | Optional | Ignored for code.storage providers |
name | Required | Source repository URL (name) to fork from |
operation | Required | Set to "fork" |
ref | Optional | Branch or tag name to fork from |
sha | Optional | Exact commit SHA to fork at (overrides ref) |
auth.token | Required | JWT with git:read scope for the source repository |
JWT Requirements
- Requires the
repo:writescope for the new repository - For forking,
base_repo.auth.tokenmust havegit:readscope for the source repository
Response
Error Responses
| Status | Description |
|---|---|
401 Unauthorized | Invalid JWT or missing required scope |
409 Conflict | Repository already exists |