---
updatedAt: 2026-04-22T14:30:04.000Z
agentTools:
  projectIndex: https://developers.sqldbm.com/llms.txt
---

# Create a branch of an existing project

Creates a branch from the project's latest revision.

# OpenAPI definition

```json
{
  "openapi": "3.0.4",
  "info": {
    "title": "SqlDBM.OpenAPI",
    "description": "Requests are authorised with a bearer token. Endpoints that create something return 202 and finish the work\nafter responding.\n\nRequest bodies may be compressed with gzip, deflate, br (Brotli) or zstd using the Content-Encoding header.\nThe limit is 15 MB on the wire and 100 MB once decompressed. File uploads state their own limit.",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.sqldbm.com"
    }
  ],
  "paths": {
    "/projects/{projectId}/branches": {
      "post": {
        "tags": [
          "Create and update projects"
        ],
        "summary": "Create a branch of an existing project",
        "description": "Creates a branch from the project's latest revision.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBranchRequest"
              },
              "example": {
                "branchName": "feature/add-orders",
                "revisionName": "Initial branch revision"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBranchRequest"
              },
              "example": {
                "branchName": "feature/add-orders",
                "revisionName": "Initial branch revision"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBranchRequest"
              },
              "example": {
                "branchName": "feature/add-orders",
                "revisionName": "Initial branch revision"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/CreateBranchRequest"
              },
              "example": "<CreateBranchRequest xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.datacontract.org/2004/07/SqlDbm.OpenAPI.Model.Projects\">\n  <BranchName>feature/add-orders</BranchName>\n  <RevisionName>Initial branch revision</RevisionName>\n</CreateBranchRequest>"
            },
            "text/xml": {
              "schema": {
                "$ref": "#/components/schemas/CreateBranchRequest"
              },
              "example": "<CreateBranchRequest xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.datacontract.org/2004/07/SqlDbm.OpenAPI.Model.Projects\">\n  <BranchName>feature/add-orders</BranchName>\n  <RevisionName>Initial branch revision</RevisionName>\n</CreateBranchRequest>"
            },
            "application/*+xml": {
              "schema": {
                "$ref": "#/components/schemas/CreateBranchRequest"
              },
              "example": "<CreateBranchRequest xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.datacontract.org/2004/07/SqlDbm.OpenAPI.Model.Projects\">\n  <BranchName>feature/add-orders</BranchName>\n  <RevisionName>Initial branch revision</RevisionName>\n</CreateBranchRequest>"
            }
          }
        },
        "responses": {
          "202": {
            "description": "Branch creation accepted"
          },
          "400": {
            "description": "The API call was not formed correctly",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": 400,
                  "type": "Invalid_Syntax",
                  "message": "The API call was not formed correctly"
                }
              }
            }
          },
          "401": {
            "description": "The API call was not made by an authorized agent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": 401,
                  "type": "Unauthorized",
                  "message": "The API call was not made by an authorized agent"
                }
              }
            }
          },
          "403": {
            "description": "The requested resource or operation is forbidden to the calling user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": 403,
                  "type": "Forbidden",
                  "message": "The requested resource or operation is forbidden to the calling user"
                }
              }
            }
          },
          "404": {
            "description": "The requested object or resource could not be found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": 404,
                  "type": "Not_Found",
                  "message": "The requested object or resource could not be found"
                }
              }
            }
          },
          "409": {
            "description": "Branch name already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": 409,
                  "type": "Conflict",
                  "message": "Branch name already exists"
                }
              }
            }
          },
          "415": {
            "description": "Use application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": 415,
                  "type": "UnsupportedMediaType",
                  "message": "Use application/json"
                }
              }
            }
          },
          "429": {
            "description": "The request was rejected due to high inbound volume",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": 429,
                  "type": "Too_Many_Requests",
                  "message": "The request was rejected due to high inbound volume"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error has occurred and will require support",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": 500,
                  "type": "Server_Error",
                  "message": "An unexpected error has occurred and will require support"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CreateBranchRequest": {
        "required": [
          "branchName"
        ],
        "type": "object",
        "properties": {
          "branchName": {
            "minLength": 1,
            "type": "string",
            "description": "Name for the new branch. Must be unique among branches of the project."
          },
          "revisionName": {
            "type": "string",
            "description": "Name for the initial revision of the branch. Defaults to \"Initial revision\" if not provided.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Request body for creating a branch of a project."
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Standard error response returned by the API for non-2xx status codes."
      }
    },
    "securitySchemes": {
      "OpenApiBearerAuthentication": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "OpenApiBearerAuthentication": []
    }
  ],
  "tags": [
    {
      "name": "Create and update projects"
    }
  ]
}
```