Netlify Netlify's API documentation
Netlify is a hosting service for the programmable web. It understands your documents and provides an API to handle atomic deploys of websites, manage form submissions, inject JavaScript snippets, and much more. This is a REST-style API that uses JSON for serialization and OAuth 2 for authentication. This document is an OpenAPI reference for the Netlify API that you can explore. For more detailed instructions for common uses, please visit the [online documentation](https://www.netlify.com/docs/api/). Visit our Community forum to join the conversation about [understanding and using Netlify’s API
What You Can Do
MCP Tools
listsites
**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables.
createsite
**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [createEnvVars](#tag/environmentVariables/operation/createEnvVars) to create environment variables for a site.
getsite
**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables.
deletesite
DELETE /sites/{site_id}
updatesite
**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [updateEnvVar](#tag/environmentVariables/operation/updateEnvVar) to update a site's environment variables.
showsitetlscertificate
GET /sites/{site_id}/ssl
provisionsitetlscertificate
POST /sites/{site_id}/ssl
getenvvars
Returns all environment variables for an account or site. An account corresponds to a team in the Netlify UI. To use this endpoint, your site must no longer be using the read-only idempotent
createenvvars
Creates new environment variables. Granular scopes are available on Pro plans and above. To use this endpoint, your site must no longer be using the classic enviro
getsiteenvvars
Returns all environment variables for a site. This convenience method behaves the same as `getEnvVars` but doesn't require an `account_id` as input.
getenvvar
Returns an individual environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now w
updateenvvar
Updates an existing environment variable and all of its values. Existing values will be replaced by values provided. To use this endpoint, your site must no longer be using the idempotent
deleteenvvar
Deletes an environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Net
setenvvarvalue
Updates or creates a new value for an existing environment variable. To use this endpoint, your site must no longer be using the classic environment variables expe
deleteenvvarvalue
Deletes a specific environment variable value. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate no
searchsitefunctions
GET /sites/{site_id}/functions
listsiteforms
GET /sites/{site_id}/forms
deletesiteform
DELETE /sites/{site_id}/forms/{form_id}
listsitesubmissions
GET /sites/{site_id}/submissions
listsitefiles
GET /sites/{site_id}/files
listsiteassets
GET /sites/{site_id}/assets
createsiteasset
POST /sites/{site_id}/assets
getsiteassetinfo
GET /sites/{site_id}/assets/{asset_id}
updatesiteasset
PUT /sites/{site_id}/assets/{asset_id}
deletesiteasset
DELETE /sites/{site_id}/assets/{asset_id}
getsiteassetpublicsignature
GET /sites/{site_id}/assets/{asset_id}/public_signature
getsitefilebypathname
GET /sites/{site_id}/files/{file_path}
purgecache
Purges cached content from Netlify's CDN. Supports purging by Cache-Tag.
listsitesnippets
GET /sites/{site_id}/snippets
createsitesnippet
POST /sites/{site_id}/snippets
getsitesnippet
GET /sites/{site_id}/snippets/{snippet_id}
updatesitesnippet
PUT /sites/{site_id}/snippets/{snippet_id}
deletesitesnippet
DELETE /sites/{site_id}/snippets/{snippet_id}
getsitemetadata
GET /sites/{site_id}/metadata
updatesitemetadata
PUT /sites/{site_id}/metadata
listsitebuildhooks
GET /sites/{site_id}/build_hooks
createsitebuildhook
POST /sites/{site_id}/build_hooks
getsitebuildhook
GET /sites/{site_id}/build_hooks/{id}
updatesitebuildhook
PUT /sites/{site_id}/build_hooks/{id}
deletesitebuildhook
DELETE /sites/{site_id}/build_hooks/{id}
listsitedeploys
GET /sites/{site_id}/deploys
createsitedeploy
POST /sites/{site_id}/deploys
getsitedeploy
GET /sites/{site_id}/deploys/{deploy_id}
updatesitedeploy
PUT /sites/{site_id}/deploys/{deploy_id}
deletesitedeploy
DELETE /sites/{site_id}/deploys/{deploy_id}
cancelsitedeploy
POST /deploys/{deploy_id}/cancel
restoresitedeploy
POST /sites/{site_id}/deploys/{deploy_id}/restore
listsitebuilds
GET /sites/{site_id}/builds
createsitebuild
POST /sites/{site_id}/builds
listsitedeployedbranches
GET /sites/{site_id}/deployed-branches
unlinksiterepo
[Beta] Unlinks the repo from the site. This action will also: - Delete associated deploy keys - Delete outgoing webhooks for the repo - Delete the site's build hooks
getsitebuild
GET /builds/{build_id}
updatesitebuildlog
POST /builds/{build_id}/log
notifybuildstart
POST /builds/{build_id}/start
getaccountbuildstatus
GET /{account_id}/builds/status
getdnsforsite
GET /sites/{site_id}/dns
configurednsforsite
PUT /sites/{site_id}/dns
rollbacksitedeploy
PUT /sites/{site_id}/rollback
getdeploy
GET /deploys/{deploy_id}
deletedeploy
DELETE /deploys/{deploy_id}