Introducing Confident Voice: Watch the Launch Video Now

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.

POST/v2/prompts/{promptId}/branches/{branchId}/merge
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"
}'
200
{
  "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_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • promptIdstringRequired

    The unique id of the prompt.

  • branchIdstringRequired

    The unique id of the branch.

Request body

  • messagestring

    The message of the merge commit created on main. Defaults to Merged branch '<name>' into main. when omitted or blank.

Response

Merge Prompt Branch succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    Show 3 propertiesHide 3 properties
    • idstring

      The id of a commit generated by Confident AI, not to be confused with the prompt id or the commit hash.

    • hashstring

      The hash of a commit generated by Confident AI.

    • messagestring

      The message associated with a commit, not to be confused with a prompt's messages.

  • linkstring

    This is the URL of the resource on the Confident AI platform.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI