---
title: "Set default branch"
method: POST
path: "/repos/{repo_id}/default_branch"
tags: ["Repository Manipulation"]
---

# Set default branch

`POST /repos/{repo_id}/default_branch`

Change default branch for a repository

## Request body

- SetDefaultBranchRequest
  - `branch_id` string, required — The branch ID to set as the default branch

## Response `200`

Request completed successfully

## Other responses

- `404` — The specified resource was not found
- `default` — An error occurred

---

[API](https://skmtc.dev/diversion/apis/diversion-core-api.md) · [All operations](https://skmtc.dev/diversion/apis/diversion-core-api/llms.txt) · [OpenAPI document](https://skmtc.dev/diversion/apis/diversion-core-api/revisions/38a18aba804b?raw)
