My project is linked to a (BitBucket) Git repository for continuous deployment.
The build command includes an npm script that fetches 301/302 redirects from our CMS, and writes them to the netlify.toml file.
When redirects are updated in the CMS, I therefore want to re-trigger the latest deployment so that that the netlify.toml file is regenerated and deployed.
I’m not sure how I can do this via the API. If I simply POST to https://api.netlify.com/api/v1/sites/{site_id}/deploys, without providing any request body, a build is created, but it doesn’t progress from status “New”.
It seems that I need to give it a list of files to deploy, but the only changed file is netlify.toml, which is generated dynamically at build.
I guess I just want to mimic the behaviour of the “Trigger deploy” button in the Netlify admin console: how can I do this via the API? What API route should I call, and what combination of params should I provide it?