Redeploy a branch in a site with the latest git commit using Netlify API

Hi, @burakslt. You can make the same API call that the UI does. There is a support guide about how to copy the API calls the UI makes here:

What @hrishikesh is saying is that the API call the UI makes takes a deploy id as a parameter to deploy the same branch again. You would need to know the deploy ids of a previous deploy of that same branch to use that workflow.

I do have another suggestion that might meet your requirements. That would be to use a webhook to trigger deploys as documented here:

With that webhook workflow, you can tell it what branch to trigger the build for using a parameter in the webhook URL:

If the webhooks don’t meet your requirements or if there are other questions, please let us know.

1 Like