1Create Branch in Git Connection
Overview
This API creates a new branch in the configured Git repository using the specified Git connection. The API validates the branch name and creates the branch if it does not already exist.
Method: POST
Request URL: {kyvos-url}/rest/v2/git-config/create-branch
Authorization
API Key: sessionid
This method authenticates requests using a session ID which acts like an API key.
Basic Authentication
This API authenticates requests using HTTP Basic Authentication. Pass the Base64-encoded username and password in the Authorization header.
Headers
Header Name | Type | Description | Possible Values |
|---|---|---|---|
Authorization (Required) | String | Basic Authentication credentials. |
|
Content-Type (Required) | String | Request content type. |
|
sessionid | String | The session ID is the token received from the login API. Note: Session ID is required for token-based authentication. | – |
Accept | String | Expected response type. |
|
Request Body
Parameter Name | Type | Description | Possible Values |
|---|---|---|---|
branchNameToCreate (Required) | String | Name of the branch to be created. | – |
connectionName (Required) | String | Name of the configured Git connection. | – |
sourceBranch | String | Name of the source branch from which the new branch should be created. Omit this parameter to create an orphan branch. | – |
Responses
200 Success
{
"responseTimeMs": 1402,
"status": "SUCCESS"
}Failed – Invalid Branch Name
{
"responseTimeMs": 1494,
"error": "Failed to create new branch- Branch name tes t5 is not allowed",
"status": "FAILED"
}Failed – Branch Already Exists
{
"responseTimeMs": 549,
"error": "Failed to create new branch- Given Branch name already exists. Please choose another Branch name.",
"status": "FAILED"
}Failed – Unknown Error
{
"responseTimeMs": 0,
"error": "Failed to create new branch- null",
"status": "FAILED"
}401 Unauthorized
{
"code": 401,
"message": "Authentication failed. Invalid login name or password."
}