---
title: "Create Branch"
method: POST
path: "/v1/prompts/{alias}/branches"
tags: ["Prompt"]
---

# Create Branch

`POST /v1/prompts/{alias}/branches`

## Request

- Base URL: `https://api.confident-ai.com`
- URL: `https://api.confident-ai.com/v1/prompts/{alias}/branches`
- Auth: none declared
- TypeScript: <https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/docs/v1/prompts/:alias/branches/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new branch with the specified name diverging from the main branch's head commit of your prompt.

## Request body

- CreatePromptBranchRequest
  - `branch` string, required: The unique name of the branch to create in the prompt.

## Response `200`

- CreatePromptBranchResponse
  - `success` boolean, required: This is true if the prompt branch was successfully created.
  - `data` object, required
    - `name` string, required: This is the name of the newly created prompt branch.
    - `id` string, required: This is the ID of the newly created prompt branch.
  - `link` string, required: This is the URL to the prompt branch on the Confident AI platform.
  - `deprecated` boolean, required: This is true if this endpoint is deprecated.

## Changes

> 54 revisions in range; 3 not diffed.

- **2026-03-30** `27c5711b1fb5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/changes/v1/prompts/:alias/branches/post.md)

---

[API](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api.md) - [All operations](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/llms.txt) - [OpenAPI document](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/revisions/95cdde71b65e?raw)
