canonical: https://jentic.com/apis/netlify.com/netlify

# Netlify API

Netlify is a cloud platform for deploying static sites, edge functions, and full-stack JavaScript applications directly from a Git repository. The 134-endpoint REST API gives full control over sites, builds, deploys, environment variables, DNS, forms, identity, account memberships, and audit logs. Use it to script deploys, manage multi-environment configurations, rotate environment variables, attach custom domains, and build dashboards on top of Netlify activity.

## For AI agents

Trigger deploys, manage sites, environment variables, and DNS, and stream build logs across a Netlify account.

## Scope

Does not handle code authoring, source control, or runtime application telemetry - use for site deployment, hosting configuration, and build orchestration only.

## Capabilities

- Trigger a new build for a site or restart a stuck deploy
- Promote a deploy to production or roll back to a previous deploy
- Set, update, and rotate environment variables across sites and contexts
- Attach a custom domain and manage DNS records for a Netlify-hosted site
- Stream build logs to investigate a failing deploy
- List members and audit logs for an account during a security review

## Use cases

### Programmatic Deploys from CI

Trigger a Netlify build from an external CI pipeline or content workflow when something outside Git changes (a CMS publish, a translation job, a scheduled rebuild). The API exposes site-level build hooks and deploy endpoints so the CI step can start a build, poll status, and pull logs without touching the Netlify dashboard.

Example prompt: POST to /sites/{site_id}/builds to start a new build, then poll /builds/{build_id} until state is 'done' and return the resulting deploy URL.

### Multi-Environment Variable Management

Manage environment variables across production, deploy-preview, and branch-deploy contexts for many sites at once. The account-level env endpoints let a script or agent set, rotate, or remove a variable everywhere it appears, which is essential when secrets like API keys need rotating across an organisation.

Example prompt: Update STRIPE_KEY across all sites in account ACC-1 to a new value scoped to the production context only, and confirm the update on each site.

### Custom Domain and DNS Automation

Provision a new custom domain on a Netlify site, attach a managed SSL certificate, and update DNS records via the API. Useful for white-label platforms that spin up a Netlify site per customer and need to attach customer-supplied domains automatically.

Example prompt: Attach customer.example.com to site SITE-99, provision an SSL certificate, and verify DNS resolution succeeds.

### Build and Deploy Observability

Surface deploy success rates, build durations, and recent failures across all sites in an account into a dashboard or chatops channel. Combine /sites, /sites/{site_id}/deploys, and /builds endpoints to compute deploy frequency and mean time to recovery without scraping the dashboard.

Example prompt: List all deploys for site SITE-7 in the last 24 hours, count failures, and post a summary to the team's chat channel.

### AI Agent Deploy Assistant

Let an AI agent answer 'why did my deploy fail?' and 'roll it back' through Jentic. The agent fetches the failing deploy, retrieves the build log, identifies the failing step, and either restarts the build or restores the prior deploy on the user's confirmation.

Example prompt: If the latest deploy of site SITE-7 has state 'error', fetch its build log, summarise the failing step, and restore the previous successful deploy.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /accounts | List accounts the token has access to |
| POST | /builds/{build_id}/start | Start a build |
| GET | /builds/{build_id}/log | Fetch the build log |
| GET | /accounts/{account_id}/env | List account-scoped environment variables |
| GET | /deploys/{deploy_id} | Get a deploy by id |
| POST | /billing/payment_methods | Manage billing payment methods |

## Key resources

- **Site** — A Netlify-hosted site with its own builds, deploys, and configuration
- **Build** — An individual build run for a site, with logs and status
- **Deploy** — A built artefact that can be promoted to production or rolled back
- **Account** — Top-level Netlify account with members, billing, and audit logs
- **Environment Variables** — Per-site and per-account env vars scoped to deploy contexts
- **DNS Zone** — Managed DNS zones and records for custom domains
- **Form** — Form submissions captured from Netlify-hosted forms

## Why Jentic

- **Setup:** Wiring Netlify by hand means completing its OAuth2 flow, targeting the api.netlify.com/api/v1 host, and coordinating build, deploy, and account calls across many endpoints yourself. Through Jentic you install once, import Netlify from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Netlify puts the build and deploy ids in the URL path (/builds/{build_id}/start, /deploys/{deploy_id}), so a rule can pin your agent to one build or deploy. You choose the operations it may call, so billing operations like adding a payment method are not included unless you add them.
- **Credential handling:** Your Netlify access token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'trigger a Netlify deploy' or 'read a build log', and Jentic returns the matching operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Vercel API** — Vercel is the closest competitor - same Git-driven deploy model with stronger Next.js framework integration.
- **Render API** — Render covers static sites plus long-running services and managed databases, beyond Netlify's Jamstack focus.
- **GitHub API** — GitHub hosts the source of truth that Netlify deploys from; the GitHub API drives PRs and webhooks that trigger builds.
- **Cloudflare API** — Cloudflare provides DNS, WAF, and CDN that frequently sit in front of Netlify-hosted sites.

## FAQ

### What authentication does the Netlify API use?

Netlify uses OAuth 2.0 personal access tokens. Pass the token in the Authorization header as 'Bearer {token}'. Through Jentic the token is stored encrypted and rotated centrally instead of being pasted into agent code.

### Can I trigger a Netlify build through the API?

Yes. POST /builds/{build_id}/start (re)starts a specific build, and POST /sites/{site_id}/builds creates a new build for a site. The response returns a build id you can poll on /builds/{build_id} for status.

### Can I roll back a deploy with the Netlify API?

Yes. List deploys via GET /sites/{site_id}/deploys, then POST /deploys/{deploy_id}/restore to restore a previous deploy as the published version. The current deploy is preserved in history.

### What are the rate limits for the Netlify API?

Netlify enforces 500 requests per minute per token for most endpoints, with stricter limits on deploy creation. The X-RateLimit-Remaining response header shows current budget. Plan accordingly when scripting bulk operations.

### How do I stream build logs through Jentic?

Run jentic.search('get netlify build log'), load the matching operation, then execute GET /builds/{build_id}/log with the build id. Jentic returns the log payload that the agent can summarise or feed into an alert.

### Can I manage environment variables across deploy contexts with the Netlify API?

Yes. The /accounts/{account_id}/env and /api/v1/sites/{site_id}/env endpoints accept per-context values for production, deploy-preview, and branch-deploy. PATCH lets you update the value in one context without touching the others.

### Can I limit what my agent is allowed to do with the Netlify API?

Yes. Because you run Jentic One yourself, your own rules decide which Netlify operations and credentials the agent can use. You choose the exact operations it may call, so build and deploy actions like starting a build (/builds/{build_id}/start) or restoring a prior deploy (/deploys/{deploy_id}) can be allowed while billing operations such as adding a payment method stay out unless you add them. Since Netlify puts the build and deploy id in the URL path, a rule can also pin the agent to a single build or deploy.
