Cannot change main branch for my repo via REST API

I tried to use this method https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-put to update repository settings and change the main branch. I see that it can be inside the request body, so I assume it should change the main branch. Response is 200. But I don’t see any changes

The body is

{
    "mainbranch": {
        "name": "new-main-branch",
        "type": "branch"
    }
}