Code references
Upsert branch
Create a new branch if it doesn't exist, or update the branch if it already exists.
put/api/v2/code-refs/repositories/{repo}/branches/{branch}
Path parameters
repostring string required
The repository name
The repository name
branchstring string required
The URL-encoded branch name
The URL-encoded branch name
Request body
Example request
{
"name": "main",
"head": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
"updateSequenceId": 25,
"references": [
{
"path": "/main/index.js",
"hint": "javascript",
"hunks": [
{
"startingLineNumber": 45,
"lines": "var enableFeature = 'enable-feature';",
"projKey": "default",
"flagKey": "enable-feature",
"aliases": [
"enableFeature",
"EnableFeature"
]
}
]
}
]
}Response
Action succeeded