Merge Prompt Branch
(v2)POST
Merges a branch into main by committing the branch's head content on main, and returns that merge commit. Pull it with its hash to use the merged prompt. Any open pull requests between the branch and main are marked as merged. The branch is kept, and the main branch cannot be merged into itself.
curl -X POST "https://api.confident-ai.com/v2/prompts/{promptId}/branches/{branchId}/merge" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"message": "Ship the friendlier support tone"
}'{
"success": true,
"data": {
"id": "<COMMIT-ID>",
"hash": "bab04ce",
"message": "Committed from API"
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/prompt-studio/<PROMPT-ID>?branch=main",
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
promptIdstringRequiredThe unique id of the prompt.
branchIdstringRequiredThe unique id of the branch.
Request body
messagestringThe message of the merge commit created on
main. Defaults toMerged branch '<name>' into main.when omitted or blank.
Response
Merge Prompt Branch succeeded.
successbooleanIndicates if the request was successful.
dataobjectShow 3 propertiesHide 3 properties
idstringThe id of a commit generated by Confident AI, not to be confused with the prompt id or the commit hash.
hashstringThe hash of a commit generated by Confident AI.
messagestringThe message associated with a commit, not to be confused with a prompt's messages.
linkstringThis is the URL of the resource on the Confident AI platform.
deprecatedbooleanIndicates if this endpoint is deprecated.