Maton

Netlify

Access the Netlify API with managed OAuth authentication. View sites, deploys, builds, DNS zones, environment variables, and webhooks. Administrative write operations require explicit approval.

Reference

Get Current User

GET /netlify/api/v1/user

List Accounts

GET /netlify/api/v1/accounts

Get Account

GET /netlify/api/v1/accounts/{account_id}

List Sites

GET /netlify/api/v1/sites

With filtering:

GET /netlify/api/v1/sites?filter=all&page=1&per_page=100

Get Site

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

Create Site

POST /netlify/api/v1/{account_slug}/sites
Content-Type: application/json

{
  "name": "my-new-site"
}

Update Site

PUT /netlify/api/v1/sites/{site_id}
Content-Type: application/json

{
  "name": "updated-site-name"
}

Delete Site

DELETE /netlify/api/v1/sites/{site_id}

List Deploys

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

Get Deploy

GET /netlify/api/v1/deploys/{deploy_id}

Create Deploy

POST /netlify/api/v1/sites/{site_id}/deploys
Content-Type: application/json

{
  "title": "Deploy from API"
}

Lock Deploy

POST /netlify/api/v1/deploys/{deploy_id}/lock

Unlock Deploy

POST /netlify/api/v1/deploys/{deploy_id}/unlock

Restore Deploy (Rollback)

PUT /netlify/api/v1/deploys/{deploy_id}

List Builds

GET /netlify/api/v1/sites/{site_id}/builds

Get Build

GET /netlify/api/v1/builds/{build_id}

Trigger Build

POST /netlify/api/v1/sites/{site_id}/builds

List Environment Variables

GET /netlify/api/v1/accounts/{account_id}/env?site_id={site_id}

Create Environment Variables

POST /netlify/api/v1/accounts/{account_id}/env?site_id={site_id}
Content-Type: application/json

[
  {
    "key": "MY_VAR",
    "values": [
      {"value": "my_value", "context": "all"}
    ]
  }
]

Context values: all, production, deploy-preview, branch-deploy, dev

Update Environment Variable

PUT /netlify/api/v1/accounts/{account_id}/env/{key}?site_id={site_id}
Content-Type: application/json

{
  "key": "MY_VAR",
  "values": [
    {"value": "updated_value", "context": "all"}
  ]
}

Delete Environment Variable

DELETE /netlify/api/v1/accounts/{account_id}/env/{key}?site_id={site_id}

List DNS Zones

GET /netlify/api/v1/dns_zones

Create DNS Zone

POST /netlify/api/v1/dns_zones
Content-Type: application/json

{
  "name": "example.com",
  "account_slug": "my-account"
}

Get DNS Zone

GET /netlify/api/v1/dns_zones/{zone_id}

Delete DNS Zone

DELETE /netlify/api/v1/dns_zones/{zone_id}

List DNS Records

GET /netlify/api/v1/dns_zones/{zone_id}/dns_records

Create DNS Record

POST /netlify/api/v1/dns_zones/{zone_id}/dns_records
Content-Type: application/json

{
  "type": "A",
  "hostname": "www",
  "value": "192.0.2.1",
  "ttl": 3600
}

Delete DNS Record

DELETE /netlify/api/v1/dns_zones/{zone_id}/dns_records/{record_id}

List Build Hooks

GET /netlify/api/v1/sites/{site_id}/build_hooks

Create Build Hook

POST /netlify/api/v1/sites/{site_id}/build_hooks
Content-Type: application/json

{
  "title": "My Build Hook",
  "branch": "main"
}

Response includes a url that can be POSTed to trigger a build.

Delete Build Hook

DELETE /netlify/api/v1/sites/{site_id}/build_hooks/{hook_id}

List Webhooks

GET /netlify/api/v1/hooks?site_id={site_id}

Create Webhook

POST /netlify/api/v1/hooks?site_id={site_id}
Content-Type: application/json

{
  "type": "url",
  "event": "deploy_created",
  "data": {
    "url": "https://example.com/webhook"
  }
}

Events: deploy_created, deploy_building, deploy_failed, deploy_succeeded, form_submission

Delete Webhook

DELETE /netlify/api/v1/hooks/{hook_id}

List Forms

GET /netlify/api/v1/sites/{site_id}/forms

List Form Submissions

GET /netlify/api/v1/sites/{site_id}/submissions

Delete Form

DELETE /netlify/api/v1/sites/{site_id}/forms/{form_id}

List Functions

GET /netlify/api/v1/sites/{site_id}/functions

List Available Services

GET /netlify/api/v1/services

Get Service Details

GET /netlify/api/v1/services/{service_id}

Resources

On this page