Options
Repository ID. If not provided, a UUID will be auto-generated. Supports namespacing with
/ (e.g., team/project-alpha).Default branch name for the repository. Defaults to
main.Configuration for Git Sync or forking from an existing repository. See below for structure.
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:GitHub repository owner (username or organization).
GitHub repository name.
GitHub repository’s default branch.
BaseRepo for Forking
Use this structure to fork from an existing Code Storage repository:The source repository ID to fork from.
Branch or tag name to fork from. Forks the tip of this ref.
Exact commit SHA to fork at. Overrides
ref if both are provided.Response
The repository identifier
The repository’s default branch name (e.g.,
main)BaseRepo for Git Sync
Use this structure to sync with a GitHub repository:WhenbaseRepocontainsownerandname, Code Storage links the repository to an external Git provider for syncing. See the Integrations 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:WhenbaseRepocontainsid, a fork is created from the specified repository. See the Forking guide for details.
Response
Returns aRepository instance with the following properties:
The returned repository instance also provides methods for managing branches, commits, files, and more. See the other SDK reference pages for details.