---
title: "Set default branch"
method: POST
path: "/api/v1/repositories/set-default-branch"
tags: ["Repositories"]
---

# Set default branch

`POST /api/v1/repositories/set-default-branch`

## Request

- Base URL: `https://zeropath.com`
- URL: `https://zeropath.com/api/v1/repositories/set-default-branch`
- Auth: API key in header `X-ZeroPath-API-Token-Id` and API key in header `X-ZeroPath-API-Token-Secret`

Set the default branch for repository scans and PRs

## Request body

- object
  - `organizationId` string, required: Organization containing the repository
  - `repositoryId` string, required: Repository to update
  - `defaultBranch` string, required: Name of the branch to set as default (e.g., "main", "master")

## Response `200`

Successful response

- object
  - `ok` boolean

---

[API](https://skmtc.dev/zeropath/apis/zeropath-api.md) - [All operations](https://skmtc.dev/zeropath/apis/zeropath-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zeropath/apis/zeropath-api/revisions/126e9c80ba0d?raw)
