Netlify API

Netlify has a comprehensive and well documented API.

# Netlify CLI An alternate way to interact programtically with Netlify is to use the netlify CLI tool.

# Basics

All urls start with (SSL only):

https://api.netlify.com/api/v1/

To make a request for all sites you have access to, for example, append the sites index path to the base URL to form something like:

https://api.netlify.com/api/v1/sites

Here’s an example in curl:

curl -H "User-Agent: MyApp (YOUR_NAME@EXAMPLE.COM)" \ -H "Authorization: Bearer YOUR_OAUTH2_ACCESS_TOKEN" \ https://api.netlify.com/api/v1/sites

The most important advice I can give you about using our API is to watch how we do it! Our entire admin UI 248 works via this API, so checking to see how we use the API in-app will be the best guide to using every feature.

You can use your browser’s developer tools 79 to accomplish this! Note that while our UI uses calls to URLs like https://app.netlify.com/access-control/bb-api/api/v1/..., you’ll want to use the endpoint https://api.netlify.com/api/v1/... instead (the specific methods and endpoints will be the same for each, such as HTTP POST to .../hooks/your-hook-id-here).