APIHub
Back to Explore

Netlify

The Netlify API is a REST interface that lets you programmatically create and manage Netlify sites and apps—including atomic deploys via file digests or ZIP uploads—as well as related resources such as environment variables, forms, DNS, and site metadata.

Development
bearer
HTTPS
CORS: Unknown
Description enriched
Visit official documentation

Latency

373ms p95

Uptime

100.0% 30d

Playground

Verified

live

Endpoints

REST · JSON
DELETE

/sites/{site_id}

Permanently deletes a site.

  • site_id (path, required) — The identifier of the site to delete.
GET

/sites/{site_id}/metadata

Gets the metadata object for a site.

  • site_id (path, required) — The identifier of the site.
PUT

/sites/{site_id}/metadata

Replaces a site's metadata object.

  • site_id (path, required) — The identifier of the site.
GET

/sites

Returns all sites you have access to.

GET

/sites/{site_id}

Returns the specified site.

  • site_id (path, required) — The identifier of the site (can be the site ID or its domain).
POST

/sites

Creates a new site in the personal team.

POST

/{account_slug}/sites

Creates a new site in a specific team.

  • account_slug (path, required) — The slug of the account (team) where the site will be created.
PATCH

/sites/{site_id}

Updates some attributes on a site.

  • site_id (path, required) — The identifier of the site to update.
PUT

/sites/{site_id}

Replaces a site's attributes (full update).

  • site_id (path, required) — The identifier of the site to replace.
POST

/sites/{site_id}/ssl

Activates SSL for a site with a custom domain.

  • site_id (path, required) — The identifier of the site for which SSL will be provisioned.
GET

/accounts/{account_id}/env

Returns all environment variables for a team or site.

  • account_id (path, required) — The identifier of the account (team). Can also be the account slug.
GET

/accounts/{account_id}/env/{key}

Returns a single environment variable for a team or site.

  • account_id (path, required) — The identifier of the account (team).
  • key (path, required) — The name of the environment variable.
POST

/accounts/{account_id}/env

Creates site or shared environment variables.

  • account_id (path, required) — The identifier of the account (team).
PUT

/accounts/{account_id}/env/{key}

Updates an existing environment variable by replacing all of its values.

  • account_id (path, required) — The identifier of the account (team).
  • key (path, required) — The name of the environment variable to update.
PATCH

/accounts/{account_id}/env/{key}

Updates or creates a new value for an existing environment variable.

  • account_id (path, required) — The identifier of the account (team).
  • key (path, required) — The name of the environment variable.
DELETE

/accounts/{account_id}/env/{key}

Deletes an environment variable and all of its values.

  • account_id (path, required) — The identifier of the account (team).
  • key (path, required) — The name of the environment variable to delete.
DELETE

/accounts/{account_id}/env/{key}/value/{id}

Deletes a specific environment variable value.

  • account_id (path, required) — The identifier of the account (team).
  • key (path, required) — The name of the environment variable.
  • id (path, required) — The identifier of the specific value to delete.
GET

/sites/{site_id}/files

Returns a list of all the files in the current deploy.

  • site_id (path, required) — The identifier of the site.
GET

/sites/{site_id}/files/{file_path}

Returns metadata for a specific file.

  • site_id (path, required) — The identifier of the site.
  • file_path (path, required) — The path of the file (URL‑encoded).
POST

/sites/{site_id}/deploys

Creates a new deploy using a file digest (or ZIP file).

  • site_id (path, required) — The identifier of the site to deploy to.
PUT

/deploys/{deploy_id}/files/{file_path}

Uploads a file's contents for a deploy.

  • deploy_id (path, required) — The identifier of the deploy returned by the file‑digest request.
  • file_path (path, required) — The path of the file being uploaded (URL‑encoded).
PUT

/deploys/{deploy_id}/functions/{function_name}

Uploads a serverless function for a deploy.

  • deploy_id (path, required) — The identifier of the deploy.
  • function_name (path, required) — The name of the function (no file extension).
  • runtime (query) — Specifies the runtime for the function (e.g., js or go).
GET

/sites/{site_id}/deploys/{deploy_id}

Retrieves the state of a specific deploy (preparing, uploading, ready, etc.).

  • site_id (path, required) — The identifier of the site.
  • deploy_id (path, required) — The identifier of the deploy.
GET

/deploys/{deploy_id}

Polls a deploy to check if it is ready.

  • deploy_id (path, required) — The identifier of the deploy.

24 endpoints auto-detected

Authentication

This API uses Bearer token authentication — pass your token in the Authorization header.

curl -X DELETE \
  "https://docs.netlify.com/api/get-started//sites/{site_id}" \
  -H "Authorization: Bearer YOUR_TOKEN"

docs.netlify.com · HTTPS only