Create Prompt Pull Request
(v2)POST
Opens a pull request proposing to merge the source branch of the prompt into the target branch, and returns its id. The pull request is attributed to the owner of the API key or the signed-in MCP user, so a key without an owner is rejected. The source branch must have commits, the two branches must differ, and only one pull request can be open for a branch pair.
curl -X POST "https://api.confident-ai.com/v2/prompts/{promptId}/pull-requests" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"title": "Tighten the support tone",
"description": "Shortens the greeting and drops the apology.",
"sourceBranchId": "<SOURCE-BRANCH-ID>",
"targetBranchId": "<TARGET-BRANCH-ID>"
}'{
"success": true,
"data": {
"id": "<PULL-REQUEST-ID>"
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
promptIdstringRequiredThe unique id of the prompt.
Request body
titlestringRequiredThe title of the pull request.
descriptionstring | nullWhat the pull request changes and why. Omit to leave it empty when opening, or to keep the stored value when updating; send
nullwhen updating to clear it.sourceBranchIdstringThe id of the branch whose changes are proposed. Required when opening a pull request, and it must have at least one commit. Ignored when updating, since a pull request keeps its branches.
targetBranchIdstringThe id of the branch the changes would be merged into, different from the source branch. Required when opening a pull request. Ignored when updating.
Response
Create Prompt Pull Request succeeded.
successbooleanIndicates if the request was successful.
dataobjectA reference to a prompt pull request by its id.
Show 1 propertyHide 1 property
idstringThe unique id of the pull request.
deprecatedbooleanIndicates if this endpoint is deprecated.