When you deploy a project using a ZIP file and the Netlify API, you can now also create branch deploys using the new branch parameter.
While it was always possible to pass a branch parameter to the https://api.netlify.com/api/v1/sites/{site_id}/builds endpoint, it previously had no effect for deploys made programmatically using the API. Now, when creating a ZIP-based deploy via the API, including the branch parameter will properly create a branch deploy instead of a production deploy.
This means teams using ZIP-based workflows through our API can now take full advantage of Netlify’s branch deploy features like preview URLs, and isolated testing environments for different branches.
To create a branch deploy for a ZIP-based site, simply include the branch parameter in your API request:
curl -X POST \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "zip=@your-site.zip" \
-F "branch=feature-branch" \
https://api.netlify.com/api/v1/sites/{site_id}/builds
Learn more about the Netlify API builds endpoint in the documentation.

























