Introducing Confident Voice: Watch the Launch Video Now

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.

POST/v2/prompts/{promptId}/pull-requests
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>"
}'
200
{
  "success": true,
  "data": {
    "id": "<PULL-REQUEST-ID>"
  },
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • promptIdstringRequired

    The unique id of the prompt.

Request body

  • titlestringRequired

    The title of the pull request.

  • descriptionstring | null

    What the pull request changes and why. Omit to leave it empty when opening, or to keep the stored value when updating; send null when updating to clear it.

  • sourceBranchIdstring

    The 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.

  • targetBranchIdstring

    The 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.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    A reference to a prompt pull request by its id.

    Show 1 propertyHide 1 property
    • idstring

      The unique id of the pull request.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI