Home
Support Forums

Possibility to trigger deploy preview from API

Dear concerns,

I’m building a platform for our developers to create builds of their branches. Is there any possibility to create a deploy preview link for the branches?

I have tried createsitedeploy and specifying branch name in that but deployment starts with no logs

https://api.netlify.com/api/v1/sites/{site_id}/deploys
and the payload I’m sending is

{
  "files": {},
  "draft": true,
  "async":true,
  "functions": {},
  "branch": "DIG-3421/temporary_number"
}

Please help me in fixing it or is there any other way around?

Hi there! Anything that is possible in the UI is possible in the API. Have you seen this guide on how to use our API?