Set Branch deploy via rest Api

hi,

Firstly happy new year to all.

I have requested PATCH for the https://api.netlify.com/api/v1/sites/<my site id> ,
data as

capabilities: {
                 branch_deploy: true
              }

But my site Branch deploy is not changing to “All”.
Am I doing anything wrong is there another way to do so.

Thanks, shiva

Hey @shiva,
I believe branch_deploy is a boolean- maybe you’re looking for build settings? We don’t have a public API endpoint for that endpoint as far as I know, which means that we can’t promise it will always remain available, but for the time being you can watch the network requests that our UI makes. The request is a PUT and the payload is something like this for “allow all branches”:

{
  "build_settings":
   {
    "branch": "your-prod-branch",
    "allowed_branches":[], <--- empty array means "allow all"
    "skip_prs":null
   }
}

Let us know if that helps or if you have other questions!