Skip to content
Software capabilities
Netlify

List Netlify deploys by site and branch

List Netlify deploys for a site and inspect the returned branch and deploy context. Read state and commit_ref to check the build, and published_at to see when it was published.

Documentation reviewed · 2 methods with sources

Ways to do it

  1. API: GET /api/v1/sites/{site_id}/deploys
  2. CLI: netlify api listSiteDeploys
API

GET /api/v1/sites/{site_id}/deploys

List deploys for one site and return fields such as branch, state, commit_ref, published_at, and deploy_ssl_url.

Read source: Netlify listSiteDeploys API reference
Requirements
A Netlify Bearer token with site access and the site ID.
Limitations
page and per_page control pagination. A deploy-specific URL identifies a build, while published_at describes publication.

Example shell

curl --fail "https://api.netlify.com/api/v1/sites/$NETLIFY_SITE_ID/deploys?page=1&per_page=50" -H "Authorization: Bearer $NETLIFY_AUTH_TOKEN"
CLI

netlify api listSiteDeploys

Call listSiteDeploys through the Netlify CLI and pass the site ID and page size in --data.

Read source: Netlify CLI api command
Requirements
An authenticated Netlify CLI and a site ID the account can read.
Limitations
The generic command makes the API request with the arguments you supply. Pass each page explicitly.

Example shell

netlify api listSiteDeploys --data '{"site_id":"YOUR_SITE_ID","page":1,"per_page":50}'