Create branch policy

http
POST /projects/{project_reference}/branch-policies

Create a merge policy for branches matching a pattern. Requires project.settings.manage.

Parameters

NameInRequiredDescription
project_referencepathYesProject slug, UUID, or domain that identifies the project.

Request body

FieldTypeRequiredDescription
namestringYes
is_enabledboolean
target_branch_patternstring,nullBranch-name pattern the policy applies to. Omit or send null to apply it to every branch.
required_approvalsintegerRequired approval count. Defaults to 0; MCP create_branch_policy defaults to 1.
allow_self_approvalbooleanAllow the merger’s approval to count. Defaults to true; MCP create_branch_policy defaults to false.
required_reviewer_idsarray

Responses

StatusDescription
201Policy created.
400Bad request
401Unauthorized
403Forbidden
404Not found
413Payload too large
500Server error
503internal: authentication state is temporarily unavailable and the request was not processed; retry shortly.