How to hit the Netlify API

Netlify's API lives at https://api.netlify.com/api/v1 and manages sites, deploys, and form submissions.

Authentication

Get a personal access token at app.netlify.com. Send it as Authorization: Bearer <token>. In the examples it's written {{NETLIFY_TOKEN}}.

Full reference: https://docs.netlify.com/api/get-started/

Get the current user

curl https://api.netlify.com/api/v1/user \
  -H "Authorization: Bearer {{NETLIFY_TOKEN}}"
Run in PostTaco

List sites

curl "https://api.netlify.com/api/v1/sites?per_page=5" \
  -H "Authorization: Bearer {{NETLIFY_TOKEN}}"
Run in PostTaco

A site's deploys

site_id comes from the sites call.

curl "https://api.netlify.com/api/v1/sites/{{SITE_ID}}/deploys?per_page=5" \
  -H "Authorization: Bearer {{NETLIFY_TOKEN}}"
Run in PostTaco