POST/v1/git-repos

Create or update project Git repository information

Creates or updates Git repository information for a project. Supply the project identifier, SSH remote URL, branch, branch type, private key, and slug; the branch type must be PRODUCTION or DEVELOPMENT.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

6 body fields

Git repository configuration for a project. All listed fields are required.

branchstringrequired
The repository branch name, using the allowed branch characters and a maximum length of 255 characters.
branchTypestringrequired
The branch role: PRODUCTION or DEVELOPMENT.
Allowed:PRODUCTIONDEVELOPMENT
projectIdstringrequired
The project identifier. Must contain at least one character.
remoteUrlstringrequired
The SSH remote URL, in the format git@host:path with an optional .git suffix.
slugstringrequired
The repository slug. Must contain 1 to 128 permitted characters and cannot be . or ..
sshPrivateKeystringrequired
The SSH private key. Must contain at least one character.

1 status code
201Returns the Git repository information, including its identifier, project, remote URL, branch, branch type, slug, and creation and update timestamps.
branchstringrequired
branchTypestringrequired
Allowed:PRODUCTIONDEVELOPMENT
createdstringrequired
idstringrequired
projectIdstringrequired
remoteUrlstringrequired
slugstringrequired
updatedstringrequired

Error handling

projectId, remoteUrl, branch, branchType, sshPrivateKey, and slug are required. branch must match the allowed branch format, remoteUrl must use the specified SSH URL format, and slug must contain 1 to 128 permitted characters. branchType must be PRODUCTION or DEVELOPMENT, and sshPrivateKey must contain at least one character.