Options
string
Repository ID. If not provided, a UUID will be auto-generated. Supports namespacing with
/
(e.g., team/project-alpha).string
Default branch name for the repository. Defaults to
main, or to the source repository’s default
branch when baseRepo forks an existing repository.object
Configuration for Git Sync or forking from an existing repository. See below for structure.
string
Token TTL for this invocation in seconds. Defaults to 1 hour when omitted for this call.
BaseRepo for Git Sync
Use this structure to sync with a GitHub repository:string
required
GitHub repository owner (username or organization).
string
required
GitHub repository name.
string
GitHub repository’s default branch.
WhenbaseRepocontainsownerandname, Code Storage links the repository to an external Git provider for syncing. See the GitHub Sync guide for details.
Generic Git providers such as GitLab, Bitbucket, Gitea, Forgejo, Codeberg, and SourceHut use the same repository creation flow at the HTTP API layer. After creating the repo, configure credentials with Git credentials.
BaseRepo for Forking
Use this structure to fork from an existing Code Storage repository:string
required
The source repository ID to fork from.
string
Branch or tag name to fork from. Forks the tip of this ref.
string
Exact commit SHA to fork at. Overrides
ref if both are provided.- If
shais provided, fork at that exact commit - If
refis provided, fork at the tip of that branch/tag - Otherwise, fork at the source repository’s HEAD
defaultBranch on the request to
override it.
WhenbaseRepocontainsid, a fork is created from the specified repository. See the Repository Forks guide for details.
Response
Returns aRepository instance with the following properties:
string
The repository identifier
string
The repository’s default branch name (e.g.,
main)