Netlify's API documentation (2.62.0)

Download OpenAPI specification:Download

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. Visit our Community forum to join the conversation about understanding and using Netlify's API.

Additionally, we have two API clients for your convenience:

Ticket

createTicket: Create an OAuth ticket

Authorizations:
netlifyAuth
query Parameters
client_id
required
string
Request Body schema: application/json
message
string

Responses

Request samples

Content type
application/json
{
  • "message": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "client_id": "string",
  • "authorized": true,
  • "created_at": "string"
}

showTicket: Get an OAuth ticket

Authorizations:
netlifyAuth
path Parameters
ticket_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "client_id": "string",
  • "authorized": true,
  • "created_at": "string"
}

Access token

exchangeTicket: Exchange an OAuth ticket for an access token

Authorizations:
netlifyAuth
path Parameters
ticket_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "access_token": "string",
  • "user_id": "string",
  • "user_email": "string",
  • "created_at": "string"
}

User

getCurrentUser: Get the current user

Authorizations:
netlifyAuth

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "uid": "string",
  • "full_name": "string",
  • "avatar_url": "string",
  • "email": "string",
  • "affiliate_id": "string",
  • "site_count": 0,
  • "created_at": "string",
  • "last_login": "string",
  • "login_providers": [
    ],
  • "onboarding_progress": {
    }
}

Accounts

cancelAccount: Cancel a team

Authorizations:
netlifyAuth
path Parameters
account_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

createAccount: Create a team

Authorizations:
netlifyAuth
Request Body schema: application/json
name
required
string
type_id
required
string
payment_method_id
string
period
string
Enum: "monthly" "yearly"
extra_seats_block
integer

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "type_id": "string",
  • "payment_method_id": "string",
  • "period": "monthly",
  • "extra_seats_block": 0
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "slug": "string",
  • "type": "string",
  • "capabilities": {
    },
  • "billing_name": "string",
  • "billing_email": "string",
  • "billing_details": "string",
  • "billing_period": "string",
  • "payment_method_id": "string",
  • "type_name": "string",
  • "type_id": "string",
  • "owner_ids": [
    ],
  • "roles_allowed": [
    ],
  • "created_at": "string",
  • "updated_at": "string"
}

getAccount: Get a team

Authorizations:
netlifyAuth
path Parameters
account_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "slug": "string",
  • "type": "string",
  • "capabilities": {
    },
  • "billing_name": "string",
  • "billing_email": "string",
  • "billing_details": "string",
  • "billing_period": "string",
  • "payment_method_id": "string",
  • "type_name": "string",
  • "type_id": "string",
  • "owner_ids": [
    ],
  • "roles_allowed": [
    ],
  • "created_at": "string",
  • "updated_at": "string"
}

listAccountsForUser: List the current user's teams

Authorizations:
netlifyAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

updateAccount: Update a team

Authorizations:
netlifyAuth
path Parameters
account_id
required
string
Request Body schema: application/json
name
string
slug
string
type_id
string
extra_seats_block
integer
billing_name
string
billing_email
string
billing_details
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "slug": "string",
  • "type_id": "string",
  • "extra_seats_block": 0,
  • "billing_name": "string",
  • "billing_email": "string",
  • "billing_details": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "slug": "string",
  • "type": "string",
  • "capabilities": {
    },
  • "billing_name": "string",
  • "billing_email": "string",
  • "billing_details": "string",
  • "billing_period": "string",
  • "payment_method_id": "string",
  • "type_name": "string",
  • "type_id": "string",
  • "owner_ids": [
    ],
  • "roles_allowed": [
    ],
  • "created_at": "string",
  • "updated_at": "string"
}

Member

addMemberToAccount: Add a member to a team

Authorizations:
netlifyAuth
path Parameters
account_slug
required
string
Request Body schema: application/json
role
string
Enum: "Owner" "Developer" "Billing Admin" "Reviewer"
email
string

Responses

Request samples

Content type
application/json
{
  • "role": "Owner",
  • "email": "string"
}

Response samples

Content type
application/json
[
  • {
    }
]

getAccountMember: Get a team member

Authorizations:
netlifyAuth
path Parameters
account_slug
required
string
member_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "full_name": "string",
  • "email": "string",
  • "avatar": "string",
  • "role": "string"
}

listMembersForAccount: List a team's members

Authorizations:
netlifyAuth
path Parameters
account_slug
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

removeAccountMember: Remove a team member

Authorizations:
netlifyAuth
path Parameters
account_slug
required
string
member_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

updateAccountMember: Update a team member

Authorizations:
netlifyAuth
path Parameters
account_slug
required
string
member_id
required
string
Request Body schema: application/json
role
string
Enum: "Owner" "Developer" "Billing Admin" "Reviewer"
site_access
string
Enum: "all" "none" "selected"
site_ids
Array of strings

Responses

Request samples

Content type
application/json
{
  • "role": "Owner",
  • "site_access": "all",
  • "site_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "full_name": "string",
  • "email": "string",
  • "avatar": "string",
  • "role": "string"
}

Access type

listAccountTypesForUser: List plans available for new teams

Authorizations:
netlifyAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Payment method

listPaymentMethodsForUser: List payment methods

Authorizations:
netlifyAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Audit log

listAccountAuditEvents: List a team's audit log events

Authorizations:
netlifyAuth
path Parameters
account_id
required
string
query Parameters
query
string
log_type
string
page
integer <int32>
per_page
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Site

createSite: Create a site

Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use createEnvVars to create environment variables for a site.

Authorizations:
netlifyAuth
query Parameters
configure_dns
boolean
Request Body schema: application/json
id
string
state
string
plan
string
name
string
custom_domain
string
domain_aliases
Array of strings
branch_deploy_custom_domain
string
deploy_preview_custom_domain
string
password
string
notification_email
string
url
string
ssl_url
string
admin_url
string
screenshot_url
string
created_at
string <dateTime>
updated_at
string <dateTime>
user_id
string
session_id
string
ssl
boolean
force_ssl
boolean
managed_dns
boolean
deploy_url
string
object (deploy)
account_id
string
account_name
string
account_slug
string
git_provider
string
deploy_hook
string
object
object
object (repoInfo)
id_domain
string
object
build_image
string
prerender
string
functions_region
string
prevent_non_git_prod_deploys
boolean
Default: false
object (repoInfo)

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "state": "string",
  • "plan": "string",
  • "name": "string",
  • "custom_domain": "string",
  • "domain_aliases": [
    ],
  • "branch_deploy_custom_domain": "string",
  • "deploy_preview_custom_domain": "string",
  • "password": "string",
  • "notification_email": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "screenshot_url": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "user_id": "string",
  • "session_id": "string",
  • "ssl": true,
  • "force_ssl": true,
  • "managed_dns": true,
  • "deploy_url": "string",
  • "published_deploy": {
    },
  • "account_id": "string",
  • "account_name": "string",
  • "account_slug": "string",
  • "git_provider": "string",
  • "deploy_hook": "string",
  • "capabilities": {
    },
  • "processing_settings": {
    },
  • "build_settings": {
    },
  • "id_domain": "string",
  • "default_hooks_data": {
    },
  • "build_image": "string",
  • "prerender": "string",
  • "functions_region": "string",
  • "prevent_non_git_prod_deploys": false,
  • "repo": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "string",
  • "plan": "string",
  • "name": "string",
  • "custom_domain": "string",
  • "domain_aliases": [
    ],
  • "branch_deploy_custom_domain": "string",
  • "deploy_preview_custom_domain": "string",
  • "password": "string",
  • "notification_email": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "screenshot_url": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "user_id": "string",
  • "session_id": "string",
  • "ssl": true,
  • "force_ssl": true,
  • "managed_dns": true,
  • "deploy_url": "string",
  • "published_deploy": {
    },
  • "account_id": "string",
  • "account_name": "string",
  • "account_slug": "string",
  • "git_provider": "string",
  • "deploy_hook": "string",
  • "capabilities": {
    },
  • "processing_settings": {
    },
  • "build_settings": {
    },
  • "id_domain": "string",
  • "default_hooks_data": {
    },
  • "build_image": "string",
  • "prerender": "string",
  • "functions_region": "string",
  • "prevent_non_git_prod_deploys": false
}

createSiteInTeam: Create a site in a team

Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use createEnvVars to create environment variables for a site.

Authorizations:
netlifyAuth
path Parameters
account_slug
required
string
query Parameters
configure_dns
boolean
Request Body schema: application/json
id
string
state
string
plan
string
name
string
custom_domain
string
domain_aliases
Array of strings
branch_deploy_custom_domain
string
deploy_preview_custom_domain
string
password
string
notification_email
string
url
string
ssl_url
string
admin_url
string
screenshot_url
string
created_at
string <dateTime>
updated_at
string <dateTime>
user_id
string
session_id
string
ssl
boolean
force_ssl
boolean
managed_dns
boolean
deploy_url
string
object (deploy)
account_id
string
account_name
string
account_slug
string
git_provider
string
deploy_hook
string
object
object
object (repoInfo)
id_domain
string
object
build_image
string
prerender
string
functions_region
string
prevent_non_git_prod_deploys
boolean
Default: false
object (repoInfo)

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "state": "string",
  • "plan": "string",
  • "name": "string",
  • "custom_domain": "string",
  • "domain_aliases": [
    ],
  • "branch_deploy_custom_domain": "string",
  • "deploy_preview_custom_domain": "string",
  • "password": "string",
  • "notification_email": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "screenshot_url": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "user_id": "string",
  • "session_id": "string",
  • "ssl": true,
  • "force_ssl": true,
  • "managed_dns": true,
  • "deploy_url": "string",
  • "published_deploy": {
    },
  • "account_id": "string",
  • "account_name": "string",
  • "account_slug": "string",
  • "git_provider": "string",
  • "deploy_hook": "string",
  • "capabilities": {
    },
  • "processing_settings": {
    },
  • "build_settings": {
    },
  • "id_domain": "string",
  • "default_hooks_data": {
    },
  • "build_image": "string",
  • "prerender": "string",
  • "functions_region": "string",
  • "prevent_non_git_prod_deploys": false,
  • "repo": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "string",
  • "plan": "string",
  • "name": "string",
  • "custom_domain": "string",
  • "domain_aliases": [
    ],
  • "branch_deploy_custom_domain": "string",
  • "deploy_preview_custom_domain": "string",
  • "password": "string",
  • "notification_email": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "screenshot_url": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "user_id": "string",
  • "session_id": "string",
  • "ssl": true,
  • "force_ssl": true,
  • "managed_dns": true,
  • "deploy_url": "string",
  • "published_deploy": {
    },
  • "account_id": "string",
  • "account_name": "string",
  • "account_slug": "string",
  • "git_provider": "string",
  • "deploy_hook": "string",
  • "capabilities": {
    },
  • "processing_settings": {
    },
  • "build_settings": {
    },
  • "id_domain": "string",
  • "default_hooks_data": {
    },
  • "build_image": "string",
  • "prerender": "string",
  • "functions_region": "string",
  • "prevent_non_git_prod_deploys": false
}

deleteSite: Delete a site

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

disableSite: Disable a site

Disables a site, preventing it from serving content. The site can be re-enabled later using the enable endpoint.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
reason
required
string

Reason for disabling the site

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

enableSite: Enable a site

Re-enables a site that was previously disabled by the user. Sites that were disabled for usage exceeded or marked as spam cannot be re-enabled via this endpoint.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

getSite: Get a site

Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "string",
  • "plan": "string",
  • "name": "string",
  • "custom_domain": "string",
  • "domain_aliases": [
    ],
  • "branch_deploy_custom_domain": "string",
  • "deploy_preview_custom_domain": "string",
  • "password": "string",
  • "notification_email": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "screenshot_url": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "user_id": "string",
  • "session_id": "string",
  • "ssl": true,
  • "force_ssl": true,
  • "managed_dns": true,
  • "deploy_url": "string",
  • "published_deploy": {
    },
  • "account_id": "string",
  • "account_name": "string",
  • "account_slug": "string",
  • "git_provider": "string",
  • "deploy_hook": "string",
  • "capabilities": {
    },
  • "processing_settings": {
    },
  • "build_settings": {
    },
  • "id_domain": "string",
  • "default_hooks_data": {
    },
  • "build_image": "string",
  • "prerender": "string",
  • "functions_region": "string",
  • "prevent_non_git_prod_deploys": false
}

listSites: List sites

Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.

Authorizations:
netlifyAuth
query Parameters
name
string
filter
string
Enum: "all" "owner" "guest"
page
integer <int32>
per_page
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

listSitesForAccount: List a team's sites

Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.

Authorizations:
netlifyAuth
path Parameters
account_slug
required
string
query Parameters
name
string
page
integer <int32>
per_page
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

unlinkSiteRepo: Unlink a site's repository

[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
Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "string",
  • "plan": "string",
  • "name": "string",
  • "custom_domain": "string",
  • "domain_aliases": [
    ],
  • "branch_deploy_custom_domain": "string",
  • "deploy_preview_custom_domain": "string",
  • "password": "string",
  • "notification_email": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "screenshot_url": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "user_id": "string",
  • "session_id": "string",
  • "ssl": true,
  • "force_ssl": true,
  • "managed_dns": true,
  • "deploy_url": "string",
  • "published_deploy": {
    },
  • "account_id": "string",
  • "account_name": "string",
  • "account_slug": "string",
  • "git_provider": "string",
  • "deploy_hook": "string",
  • "capabilities": {
    },
  • "processing_settings": {
    },
  • "build_settings": {
    },
  • "id_domain": "string",
  • "default_hooks_data": {
    },
  • "build_image": "string",
  • "prerender": "string",
  • "functions_region": "string",
  • "prevent_non_git_prod_deploys": false
}

updateSite: Update a site

Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use updateEnvVar to update a site's environment variables.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
Request Body schema: application/json
id
string
state
string
plan
string
name
string
custom_domain
string
domain_aliases
Array of strings
branch_deploy_custom_domain
string
deploy_preview_custom_domain
string
password
string
notification_email
string
url
string
ssl_url
string
admin_url
string
screenshot_url
string
created_at
string <dateTime>
updated_at
string <dateTime>
user_id
string
session_id
string
ssl
boolean
force_ssl
boolean
managed_dns
boolean
deploy_url
string
object (deploy)
account_id
string
account_name
string
account_slug
string
git_provider
string
deploy_hook
string
object
object
object (repoInfo)
id_domain
string
object
build_image
string
prerender
string
functions_region
string
prevent_non_git_prod_deploys
boolean
Default: false
object (repoInfo)

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "state": "string",
  • "plan": "string",
  • "name": "string",
  • "custom_domain": "string",
  • "domain_aliases": [
    ],
  • "branch_deploy_custom_domain": "string",
  • "deploy_preview_custom_domain": "string",
  • "password": "string",
  • "notification_email": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "screenshot_url": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "user_id": "string",
  • "session_id": "string",
  • "ssl": true,
  • "force_ssl": true,
  • "managed_dns": true,
  • "deploy_url": "string",
  • "published_deploy": {
    },
  • "account_id": "string",
  • "account_name": "string",
  • "account_slug": "string",
  • "git_provider": "string",
  • "deploy_hook": "string",
  • "capabilities": {
    },
  • "processing_settings": {
    },
  • "build_settings": {
    },
  • "id_domain": "string",
  • "default_hooks_data": {
    },
  • "build_image": "string",
  • "prerender": "string",
  • "functions_region": "string",
  • "prevent_non_git_prod_deploys": false,
  • "repo": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "string",
  • "plan": "string",
  • "name": "string",
  • "custom_domain": "string",
  • "domain_aliases": [
    ],
  • "branch_deploy_custom_domain": "string",
  • "deploy_preview_custom_domain": "string",
  • "password": "string",
  • "notification_email": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "screenshot_url": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "user_id": "string",
  • "session_id": "string",
  • "ssl": true,
  • "force_ssl": true,
  • "managed_dns": true,
  • "deploy_url": "string",
  • "published_deploy": {
    },
  • "account_id": "string",
  • "account_name": "string",
  • "account_slug": "string",
  • "git_provider": "string",
  • "deploy_hook": "string",
  • "capabilities": {
    },
  • "processing_settings": {
    },
  • "build_settings": {
    },
  • "id_domain": "string",
  • "default_hooks_data": {
    },
  • "build_image": "string",
  • "prerender": "string",
  • "functions_region": "string",
  • "prevent_non_git_prod_deploys": false
}

Environment variables

createEnvVars: Create environment variables

Creates new environment variables. Granular scopes are available on Pro plans and above.

Authorizations:
netlifyAuth
path Parameters
account_id
required
string

Scope response to account_id

query Parameters
site_id
string

If provided, create an environment variable on the site level, not the account level

Request Body schema: application/json
Array
key
string

The existing or new name of the key, if you wish to rename it (case-sensitive)

scopes
Array of strings
Items Enum: "builds" "functions" "runtime" "post-processing"

The scopes that this environment variable is set to (Pro plans and above)

Array of objects (envVarValue)
is_secret
boolean

Secret values are only readable by code running on Netlify's systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

deleteEnvVar: Delete an environment variable

Deletes an environment variable

Authorizations:
netlifyAuth
path Parameters
account_id
required
string

Scope response to account_id

key
required
string

The environment variable key (case-sensitive)

query Parameters
site_id
string

If provided, delete the environment variable from this site

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

deleteEnvVarValue: Delete an environment variable value

Deletes a specific environment variable value.

Authorizations:
netlifyAuth
path Parameters
account_id
required
string

Scope response to account_id

id
required
string

The environment variable value's ID

key
required
string

The environment variable key name (case-sensitive)

query Parameters
site_id
string

If provided, delete the value from an environment variable on this site

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

getEnvVar: Get an environment variable

Returns an individual environment variable.

Authorizations:
netlifyAuth
path Parameters
account_id
required
string

Scope response to account_id

key
required
string

The environment variable key (case-sensitive)

query Parameters
site_id
string

If provided, return the environment variable for a specific site (no merging is performed)

Responses

Response samples

Content type
application/json
{
  • "key": "string",
  • "scopes": [
    ],
  • "values": [
    ],
  • "is_secret": true,
  • "updated_at": "2019-08-24T14:15:22Z",
  • "updated_by": {
    }
}

getEnvVars: List environment variables for a team or site

Returns all environment variables for an account or site. An account corresponds to a team in the Netlify UI.

Authorizations:
netlifyAuth
path Parameters
account_id
required
string

Scope response to account_id

query Parameters
context_name
string
Enum: "all" "dev" "dev-server" "branch-deploy" "deploy-preview" "production"

Filter by deploy context

scope
string
Enum: "builds" "functions" "runtime" "post-processing"

Filter by scope

site_id
string

If specified, only return environment variables set on this site

Responses

Response samples

Content type
application/json
[
  • {
    }
]

getSiteEnvVars: List environment variables for a site

Returns all environment variables for a site. This convenience method behaves the same as getEnvVars but doesn't require an account_id as input.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Scope response to site_id

query Parameters
context_name
string
Enum: "all" "dev" "dev-server" "branch-deploy" "deploy-preview" "production"

Filter by deploy context

scope
string
Enum: "builds" "functions" "runtime" "post_processing"

Filter by scope

Responses

Response samples

Content type
application/json
[
  • {
    }
]

setEnvVarValue: Set a value on an environment variable

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

Authorizations:
netlifyAuth
path Parameters
account_id
required
string

Scope response to account_id

key
required
string

The existing environment variable key name (case-sensitive)

query Parameters
site_id
string

If provided, update an environment variable set on this site

Request Body schema: application/json
context
string
Enum: "all" "dev" "dev-server" "branch-deploy" "deploy-preview" "production" "branch"

The deploy context in which this value will be used. dev refers to local development when running netlify dev. branch must be provided with a value in context_parameter.

context_parameter
string

An additional parameter for custom branches. Currently, this is used for providing a branch name when context=branch.

value
string

The environment variable's unencrypted value

Responses

Request samples

Content type
application/json
{
  • "context": "all",
  • "context_parameter": "string",
  • "value": "string"
}

Response samples

Content type
application/json
{
  • "key": "string",
  • "scopes": [
    ],
  • "values": [
    ],
  • "is_secret": true,
  • "updated_at": "2019-08-24T14:15:22Z",
  • "updated_by": {
    }
}

updateEnvVar: Update an environment variable

Updates an existing environment variable and all of its values. Existing values will be replaced by values provided.

Authorizations:
netlifyAuth
path Parameters
account_id
required
string

Scope response to account_id

key
required
string

The existing environment variable key name (case-sensitive)

query Parameters
site_id
string

If provided, update an environment variable set on this site

Request Body schema: application/json
key
string

The existing or new name of the key, if you wish to rename it (case-sensitive)

scopes
Array of strings
Items Enum: "builds" "functions" "runtime" "post-processing"

The scopes that this environment variable is set to (Pro plans and above)

Array of objects (envVarValue)
is_secret
boolean

Secret values are only readable by code running on Netlify's systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret.

Responses

Request samples

Content type
application/json
{
  • "key": "string",
  • "scopes": [
    ],
  • "values": [
    ],
  • "is_secret": true
}

Response samples

Content type
application/json
{
  • "key": "string",
  • "scopes": [
    ],
  • "values": [
    ],
  • "is_secret": true,
  • "updated_at": "2019-08-24T14:15:22Z",
  • "updated_by": {
    }
}

File

getSiteFileByPathName: Get a site file by path

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
file_path
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "path": "string",
  • "sha": "string",
  • "mime_type": "string",
  • "size": 0
}

listSiteFiles: List a site's files

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

uploadDeployFile: Upload a deploy file

Authorizations:
netlifyAuth
path Parameters
deploy_id
required
string
path
required
string
query Parameters
size
integer
Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "path": "string",
  • "sha": "string",
  • "mime_type": "string",
  • "size": 0
}

Metadata

getSiteMetadata: Get a site's metadata

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
{ }

updateSiteMetadata: Update a site's metadata

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
Request Body schema: application/json
object (metadata)

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Cache purge

purgeCache: Purge cached content

Purges cached content from Netlify's CDN. Supports purging by Cache-Tag.

Authorizations:
netlifyAuth
Request Body schema: application/json
site_id
string
site_slug
string
cache_tags
Array of strings

Responses

Request samples

Content type
application/json
{
  • "site_id": "string",
  • "site_slug": "string",
  • "cache_tags": [
    ]
}

Snippet

createSiteSnippet: Create a snippet

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
Request Body schema: application/json
id
integer <int32>
site_id
string
title
string
general
string
general_position
string
goal
string
goal_position
string

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "site_id": "string",
  • "title": "string",
  • "general": "string",
  • "general_position": "string",
  • "goal": "string",
  • "goal_position": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "site_id": "string",
  • "title": "string",
  • "general": "string",
  • "general_position": "string",
  • "goal": "string",
  • "goal_position": "string"
}

deleteSiteSnippet: Delete a snippet

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
snippet_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

getSiteSnippet: Get a snippet

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
snippet_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "site_id": "string",
  • "title": "string",
  • "general": "string",
  • "general_position": "string",
  • "goal": "string",
  • "goal_position": "string"
}

listSiteSnippets: List a site's snippets

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

updateSiteSnippet: Update a snippet

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
snippet_id
required
string
Request Body schema: application/json
id
integer <int32>
site_id
string
title
string
general
string
general_position
string
goal
string
goal_position
string

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "site_id": "string",
  • "title": "string",
  • "general": "string",
  • "general_position": "string",
  • "goal": "string",
  • "goal_position": "string"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

DNS zone

configureDNSForSite: Configure a site's DNS

Creates any missing DNS zones and records for the site's custom domain and domain aliases. This usually runs automatically when the custom domain is set.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

createDnsRecord: Create a DNS record

Authorizations:
netlifyAuth
path Parameters
zone_id
required
string
Request Body schema: application/json
type
string
hostname
string
value
string
ttl
integer <int64>
priority
integer <int64>
weight
integer <int64>
port
integer <int64>
flag
integer <int64>
tag
string

Responses

Request samples

Content type
application/json
{
  • "type": "string",
  • "hostname": "string",
  • "value": "string",
  • "ttl": 0,
  • "priority": 0,
  • "weight": 0,
  • "port": 0,
  • "flag": 0,
  • "tag": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "hostname": "string",
  • "type": "string",
  • "value": "string",
  • "ttl": 0,
  • "priority": 0,
  • "dns_zone_id": "string",
  • "site_id": "string",
  • "flag": 0,
  • "tag": "string",
  • "managed": true
}

createDnsZone: Create a DNS zone

Authorizations:
netlifyAuth
Request Body schema: application/json
account_slug
string
site_id
string
name
string

Responses

Request samples

Content type
application/json
{
  • "account_slug": "string",
  • "site_id": "string",
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "errors": [
    ],
  • "supported_record_types": [
    ],
  • "user_id": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "records": [
    ],
  • "dns_servers": [
    ],
  • "account_id": "string",
  • "site_id": "string",
  • "account_slug": "string",
  • "account_name": "string",
  • "domain": "string",
  • "ipv6_enabled": true,
  • "dedicated": true
}

deleteDnsRecord: Delete a DNS record

Authorizations:
netlifyAuth
path Parameters
zone_id
required
string
dns_record_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

deleteDnsZone: Delete a DNS zone

Authorizations:
netlifyAuth
path Parameters
zone_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

getDNSForSite: Get a site's DNS configuration

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

getDnsRecords: List a DNS zone's records

Authorizations:
netlifyAuth
path Parameters
zone_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

getDnsZone: Get a DNS zone

Authorizations:
netlifyAuth
path Parameters
zone_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "errors": [
    ],
  • "supported_record_types": [
    ],
  • "user_id": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "records": [
    ],
  • "dns_servers": [
    ],
  • "account_id": "string",
  • "site_id": "string",
  • "account_slug": "string",
  • "account_name": "string",
  • "domain": "string",
  • "ipv6_enabled": true,
  • "dedicated": true
}

getDnsZones: List DNS zones

Returns the DNS zones for the team given by account_slug, or all DNS zones the current user can access.

Authorizations:
netlifyAuth
query Parameters
account_slug
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

getIndividualDnsRecord: Get a DNS record

Authorizations:
netlifyAuth
path Parameters
zone_id
required
string
dns_record_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "hostname": "string",
  • "type": "string",
  • "value": "string",
  • "ttl": 0,
  • "priority": 0,
  • "dns_zone_id": "string",
  • "site_id": "string",
  • "flag": 0,
  • "tag": "string",
  • "managed": true
}

transferDnsZone: Transfer a DNS zone to another team

Authorizations:
netlifyAuth
path Parameters
zone_id
required
string
query Parameters
account_id
required
string

the account of the dns zone

transfer_account_id
required
string

the account you want to transfer the dns zone to

transfer_user_id
required
string

the user you want to transfer the dns zone to

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "errors": [
    ],
  • "supported_record_types": [
    ],
  • "user_id": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "records": [
    ],
  • "dns_servers": [
    ],
  • "account_id": "string",
  • "site_id": "string",
  • "account_slug": "string",
  • "account_name": "string",
  • "domain": "string",
  • "ipv6_enabled": true,
  • "dedicated": true
}

SNI certificate

getAllCertificates: List TLS certificates for a site's domain

Returns details about the certificates associated with a domain. The site must be using the domain.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
domain
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

provisionSiteTLSCertificate: Provision or update a site's TLS certificate

Provisions or updates a TLS certificate for the site.

Creating a certificate (site has no certificate):

  • Omit certificate params to initiate Let's Encrypt provisioning
  • Provide certificate, key, and ca_certificates to upload a custom certificate

Updating a certificate (site already has a certificate):

  • REQUIRES certificate, key, and ca_certificates to replace with a new custom certificate
  • Use POST /api/v1/sites/{site_id}/ssl/renew to renew an existing Let's Encrypt certificate
Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
certificate
string

PEM-encoded certificate. Required when updating an existing certificate.

key
string

PEM-encoded private key. Required when updating an existing certificate.

ca_certificates
string

PEM-encoded CA certificate chain. Required when updating an existing certificate.

Responses

Response samples

Content type
application/json
{
  • "state": "string",
  • "domains": [
    ],
  • "created_at": "string",
  • "updated_at": "string",
  • "expires_at": "string"
}

showSiteTLSCertificate: Get a site's TLS certificate

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
{
  • "state": "string",
  • "domains": [
    ],
  • "created_at": "string",
  • "updated_at": "string",
  • "expires_at": "string"
}

Deploy

cancelSiteDeploy: Cancel a deploy

Authorizations:
netlifyAuth
path Parameters
deploy_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "user_id": "string",
  • "build_id": "string",
  • "state": "string",
  • "name": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "deploy_url": "string",
  • "deploy_ssl_url": "string",
  • "screenshot_url": "string",
  • "review_id": 0,
  • "draft": true,
  • "required": [
    ],
  • "required_functions": [
    ],
  • "required_edge_functions": [
    ],
  • "required_server": [
    ],
  • "error_message": "string",
  • "branch": "string",
  • "commit_ref": "string",
  • "commit_url": "string",
  • "skipped": true,
  • "created_at": "string",
  • "updated_at": "string",
  • "published_at": "string",
  • "title": "string",
  • "context": "string",
  • "locked": true,
  • "review_url": "string",
  • "framework": "string",
  • "skew_protection_token": "string",
  • "function_schedules": [
    ],
  • "functions_region": "string",
  • "functions_region_overrides": [
    ]
}

createSiteDeploy: Create a deploy

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
deploy-previews
boolean
production
boolean
state
string
Enum: "new" "pending_review" "accepted" "rejected" "enqueued" "building" "uploading" "uploaded" "preparing" "prepared" "processing" "processed" "ready" "error" "retrying"
branch
string
latest-published
boolean
title
string
Request Body schema: application/json
files
object

A hash mapping file paths to SHA1 digests of the file contents.

zip
string <binary>

A zip file containing the site files to deploy. Alternative to 'files'. To use this field, set Content-Type to 'application/json' and include the zip content here. Alternatively, you can set Content-Type to 'application/zip' and send the zip as the raw request body (not as JSON).

draft
boolean
async
boolean
functions
object
edge_functions
object

A hash mapping edge-function bundle formats to the code_sha of each bundle. The response's required_edge_functions lists which of these still need to be uploaded.

object

The deploy's Netlify Server. A deploy has at most one. The response's required_server says whether it still needs to be uploaded.

Array of objects (functionSchedule)
object
branch
string
framework
string
framework_version
string
Array of objects (deployEnvironmentVariable)

A list of deploy-specific environment variable data. Data specified this way applies only to this specific deploy and is merged into any existing environment variables set on the account and site.

Deploy-specific environment variable data takes precedence over account and site environment variable data: For example, a deploy-specific variable with the key NODE_ENV will take priority over any existing site- and account-level environment variable data with the key NODE_ENV.

Environment variable data may be provided at one of two times:

  • When creating a new Deploy with deploy files (most common)
  • When finalizing an existing Deploy with deploy files

Once set, environment variables for a specific deploy cannot be modified. Subsequent attempts to modify environment variable data for a deploy will be ignored.

Responses

Request samples

Content type
application/json
{
  • "files": { },
  • "zip": "string",
  • "draft": true,
  • "async": true,
  • "functions": { },
  • "edge_functions": { },
  • "server": {
    },
  • "function_schedules": [
    ],
  • "functions_config": {
    },
  • "branch": "string",
  • "framework": "string",
  • "framework_version": "string",
  • "environment": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "user_id": "string",
  • "build_id": "string",
  • "state": "string",
  • "name": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "deploy_url": "string",
  • "deploy_ssl_url": "string",
  • "screenshot_url": "string",
  • "review_id": 0,
  • "draft": true,
  • "required": [
    ],
  • "required_functions": [
    ],
  • "required_edge_functions": [
    ],
  • "required_server": [
    ],
  • "error_message": "string",
  • "branch": "string",
  • "commit_ref": "string",
  • "commit_url": "string",
  • "skipped": true,
  • "created_at": "string",
  • "updated_at": "string",
  • "published_at": "string",
  • "title": "string",
  • "context": "string",
  • "locked": true,
  • "review_url": "string",
  • "framework": "string",
  • "skew_protection_token": "string",
  • "function_schedules": [
    ],
  • "functions_region": "string",
  • "functions_region_overrides": [
    ]
}

deleteDeploy: Delete a deploy

Marks a deploy for deletion.

Authorizations:
netlifyAuth
path Parameters
deploy_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

deleteSiteDeploy: Delete a site's deploy

Marks a deploy for deletion.

Authorizations:
netlifyAuth
path Parameters
deploy_id
required
string
site_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

getDeploy: Get a deploy

Authorizations:
netlifyAuth
path Parameters
deploy_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "user_id": "string",
  • "build_id": "string",
  • "state": "string",
  • "name": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "deploy_url": "string",
  • "deploy_ssl_url": "string",
  • "screenshot_url": "string",
  • "review_id": 0,
  • "draft": true,
  • "required": [
    ],
  • "required_functions": [
    ],
  • "required_edge_functions": [
    ],
  • "required_server": [
    ],
  • "error_message": "string",
  • "branch": "string",
  • "commit_ref": "string",
  • "commit_url": "string",
  • "skipped": true,
  • "created_at": "string",
  • "updated_at": "string",
  • "published_at": "string",
  • "title": "string",
  • "context": "string",
  • "locked": true,
  • "review_url": "string",
  • "framework": "string",
  • "skew_protection_token": "string",
  • "function_schedules": [
    ],
  • "functions_region": "string",
  • "functions_region_overrides": [
    ]
}

getSiteDeploy: Get a site's deploy

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
deploy_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "user_id": "string",
  • "build_id": "string",
  • "state": "string",
  • "name": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "deploy_url": "string",
  • "deploy_ssl_url": "string",
  • "screenshot_url": "string",
  • "review_id": 0,
  • "draft": true,
  • "required": [
    ],
  • "required_functions": [
    ],
  • "required_edge_functions": [
    ],
  • "required_server": [
    ],
  • "error_message": "string",
  • "branch": "string",
  • "commit_ref": "string",
  • "commit_url": "string",
  • "skipped": true,
  • "created_at": "string",
  • "updated_at": "string",
  • "published_at": "string",
  • "title": "string",
  • "context": "string",
  • "locked": true,
  • "review_url": "string",
  • "framework": "string",
  • "skew_protection_token": "string",
  • "function_schedules": [
    ],
  • "functions_region": "string",
  • "functions_region_overrides": [
    ]
}

listSiteDeploys: List a site's deploys

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
deploy-previews
boolean
production
boolean
state
string
Enum: "new" "pending_review" "accepted" "rejected" "enqueued" "building" "uploading" "uploaded" "preparing" "prepared" "processing" "processed" "ready" "error" "retrying"
branch
string
latest-published
boolean
page
integer <int32>
per_page
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

lockDeploy: Lock a deploy

Locks a deploy so that subsequent deploys are built but not published. If the deploy is not the site's published deploy, locking publishes it first. When publishing is gated, the publish and lock are queued and the API responds with 202 Accepted and the deploy; poll getDeploy to follow it.

Authorizations:
netlifyAuth
path Parameters
deploy_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "user_id": "string",
  • "build_id": "string",
  • "state": "string",
  • "name": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "deploy_url": "string",
  • "deploy_ssl_url": "string",
  • "screenshot_url": "string",
  • "review_id": 0,
  • "draft": true,
  • "required": [
    ],
  • "required_functions": [
    ],
  • "required_edge_functions": [
    ],
  • "required_server": [
    ],
  • "error_message": "string",
  • "branch": "string",
  • "commit_ref": "string",
  • "commit_url": "string",
  • "skipped": true,
  • "created_at": "string",
  • "updated_at": "string",
  • "published_at": "string",
  • "title": "string",
  • "context": "string",
  • "locked": true,
  • "review_url": "string",
  • "framework": "string",
  • "skew_protection_token": "string",
  • "function_schedules": [
    ],
  • "functions_region": "string",
  • "functions_region_overrides": [
    ]
}

restoreSiteDeploy: Restore a previous deploy

Publishes a previous deploy of the site.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
deploy_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "user_id": "string",
  • "build_id": "string",
  • "state": "string",
  • "name": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "deploy_url": "string",
  • "deploy_ssl_url": "string",
  • "screenshot_url": "string",
  • "review_id": 0,
  • "draft": true,
  • "required": [
    ],
  • "required_functions": [
    ],
  • "required_edge_functions": [
    ],
  • "required_server": [
    ],
  • "error_message": "string",
  • "branch": "string",
  • "commit_ref": "string",
  • "commit_url": "string",
  • "skipped": true,
  • "created_at": "string",
  • "updated_at": "string",
  • "published_at": "string",
  • "title": "string",
  • "context": "string",
  • "locked": true,
  • "review_url": "string",
  • "framework": "string",
  • "skew_protection_token": "string",
  • "function_schedules": [
    ],
  • "functions_region": "string",
  • "functions_region_overrides": [
    ]
}

rollbackSiteDeploy: Roll back a site's production deploy

Rolls back the production deploy to the deploy referenced by its rollback_id. Does nothing if the current production deploy has no rollback_id.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

unlockDeploy: Unlock a deploy

Authorizations:
netlifyAuth
path Parameters
deploy_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "user_id": "string",
  • "build_id": "string",
  • "state": "string",
  • "name": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "deploy_url": "string",
  • "deploy_ssl_url": "string",
  • "screenshot_url": "string",
  • "review_id": 0,
  • "draft": true,
  • "required": [
    ],
  • "required_functions": [
    ],
  • "required_edge_functions": [
    ],
  • "required_server": [
    ],
  • "error_message": "string",
  • "branch": "string",
  • "commit_ref": "string",
  • "commit_url": "string",
  • "skipped": true,
  • "created_at": "string",
  • "updated_at": "string",
  • "published_at": "string",
  • "title": "string",
  • "context": "string",
  • "locked": true,
  • "review_url": "string",
  • "framework": "string",
  • "skew_protection_token": "string",
  • "function_schedules": [
    ],
  • "functions_region": "string",
  • "functions_region_overrides": [
    ]
}

updateSiteDeploy: Update a deploy

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
deploy_id
required
string
query Parameters
commit_ref
string
Request Body schema: application/json
files
object

A hash mapping file paths to SHA1 digests of the file contents.

zip
string <binary>

A zip file containing the site files to deploy. Alternative to 'files'. To use this field, set Content-Type to 'application/json' and include the zip content here. Alternatively, you can set Content-Type to 'application/zip' and send the zip as the raw request body (not as JSON).

draft
boolean
async
boolean
functions
object
edge_functions
object

A hash mapping edge-function bundle formats to the code_sha of each bundle. The response's required_edge_functions lists which of these still need to be uploaded.

object

The deploy's Netlify Server. A deploy has at most one. The response's required_server says whether it still needs to be uploaded.

Array of objects (functionSchedule)
object
branch
string
framework
string
framework_version
string
Array of objects (deployEnvironmentVariable)

A list of deploy-specific environment variable data. Data specified this way applies only to this specific deploy and is merged into any existing environment variables set on the account and site.

Deploy-specific environment variable data takes precedence over account and site environment variable data: For example, a deploy-specific variable with the key NODE_ENV will take priority over any existing site- and account-level environment variable data with the key NODE_ENV.

Environment variable data may be provided at one of two times:

  • When creating a new Deploy with deploy files (most common)
  • When finalizing an existing Deploy with deploy files

Once set, environment variables for a specific deploy cannot be modified. Subsequent attempts to modify environment variable data for a deploy will be ignored.

Responses

Request samples

Content type
application/json
{
  • "files": { },
  • "zip": "string",
  • "draft": true,
  • "async": true,
  • "functions": { },
  • "edge_functions": { },
  • "server": {
    },
  • "function_schedules": [
    ],
  • "functions_config": {
    },
  • "branch": "string",
  • "framework": "string",
  • "framework_version": "string",
  • "environment": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "user_id": "string",
  • "build_id": "string",
  • "state": "string",
  • "name": "string",
  • "url": "string",
  • "ssl_url": "string",
  • "admin_url": "string",
  • "deploy_url": "string",
  • "deploy_ssl_url": "string",
  • "screenshot_url": "string",
  • "review_id": 0,
  • "draft": true,
  • "required": [
    ],
  • "required_functions": [
    ],
  • "required_edge_functions": [
    ],
  • "required_server": [
    ],
  • "error_message": "string",
  • "branch": "string",
  • "commit_ref": "string",
  • "commit_url": "string",
  • "skipped": true,
  • "created_at": "string",
  • "updated_at": "string",
  • "published_at": "string",
  • "title": "string",
  • "context": "string",
  • "locked": true,
  • "review_url": "string",
  • "framework": "string",
  • "skew_protection_token": "string",
  • "function_schedules": [
    ],
  • "functions_region": "string",
  • "functions_region_overrides": [
    ]
}

uploadDeployServer: Upload a deploy's Netlify Server bundle

Uploads the deploy's Netlify Server bundle, addressed by the digest the deploy declared in its server property.

Authorizations:
netlifyAuth
path Parameters
deploy_id
required
string
code_sha
required
string
query Parameters
size
integer
header Parameters
X-Nf-Retry-Count
integer
Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Deployed branch

listSiteDeployedBranches: List a site's deployed branches

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Deploy key

createDeployKey: Create a deploy key

Authorizations:
netlifyAuth

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "public_key": "string",
  • "created_at": "string"
}

deleteDeployKey: Delete a deploy key

Authorizations:
netlifyAuth
path Parameters
key_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

getDeployKey: Get a deploy key

Authorizations:
netlifyAuth
path Parameters
key_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "public_key": "string",
  • "created_at": "string"
}

listDeployKeys: List deploy keys

Authorizations:
netlifyAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Build

createSiteBuild: Start a build

Runs a build for a site. The build will be scheduled to run at the first opportunity, but it might not start immediately if insufficient account build capacity is available.

Files for build can be uploaded as a zipped site using one of these methods:

  1. Set Content-Type to 'application/zip' and send the zip file as the raw request body
  2. Set Content-Type to 'multipart/form-data' and include the zip file in the 'zip' field
Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
branch
string

If no branch is specified, it is treated as a production deploy If a branch IS specified and matches the main branch, it is also production If a branch is specified and doesn't match the main branch, it is a branch deploy

clear_cache
boolean

Whether to clear the build cache before building

commit_sha
string

The commit SHA to build; when omitted, the head of the branch or pull request is fetched from the git host. Ignored for zip uploads

draft
boolean

Whether to create a draft deploy, which uses the deploy-preview context and is never published; review_id builds are always drafts

image
string

The build image tag to use for the build

review_id
integer

The merge/pull request ID to build; triggers a deploy preview. Ignored for zip uploads

template_id
string

The build template to use for the build

title
string

The title of the build

Request Body schema: multipart/form-data
zip
string <binary>

A zip file containing the site files to build. Only used with Content-Type 'multipart/form-data'. Alternatively, set Content-Type to 'application/zip' and send the zip as the raw request body (no 'zip' parameter needed).

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "deploy_id": "string",
  • "sha": "string",
  • "done": true,
  • "error": "string",
  • "created_at": "string"
}

getAccountBuildStatus: Get a team's build status

Returns the team's counts of active, concurrency-pending, and enqueued builds, and its build minutes usage.

Authorizations:
netlifyAuth
path Parameters
account_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

getSiteBuild: Get a build

Authorizations:
netlifyAuth
path Parameters
build_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "deploy_id": "string",
  • "sha": "string",
  • "done": true,
  • "error": "string",
  • "created_at": "string"
}

listSiteBuilds: List a site's builds

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
page
integer <int32>
per_page
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

notifyBuildStart: Mark a build as started

Authorizations:
netlifyAuth
path Parameters
build_id
required
string
query Parameters
buildbot_version
string
build_version
string
task_id
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Build log message

updateSiteBuildLog: Add a message to a build log

Authorizations:
netlifyAuth
path Parameters
build_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Dev server

createSiteDevServer: Start a dev server

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
branch
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

deleteSiteDevServers: Stop a branch's dev servers

Stops all dev servers for a branch. Stopping happens in the background.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
branch
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

getSiteDevServer: Get a dev server

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
dev_server_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "branch": "string",
  • "url": "string",
  • "state": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "starting_at": "string",
  • "error_at": "string",
  • "live_at": "string",
  • "done_at": "string",
  • "title": "string"
}

listSiteDevServers: List a site's dev servers

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
page
integer <int32>
per_page
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

updateDevServerState: Update a dev server's state

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
dev_server_id
required
string
Request Body schema: application/json
state
required
string
Enum: "starting" "live" "error" "done"
task_id
string
error
string

Responses

Request samples

Content type
application/json
{
  • "state": "starting",
  • "task_id": "string",
  • "error": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "branch": "string",
  • "url": "string",
  • "state": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "starting_at": "string",
  • "error_at": "string",
  • "live_at": "string",
  • "done_at": "string",
  • "title": "string"
}

Agent runner

archiveAgentRunner: Archive an agent run

Authorizations:
netlifyAuth
path Parameters
agent_runner_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

createAgentRunner: Start an agent run

Authorizations:
netlifyAuth
query Parameters
site_id
required
string
deploy_id
string
branch
string
prompt
string
agent
string
model
string
parent_agent_runner_id
string
dev_server_image
string
file_keys
Array of strings

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "parent_agent_runner_id": "string",
  • "state": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "done_at": "string",
  • "title": "string",
  • "branch": "string",
  • "result_branch": "string",
  • "pr_url": "string",
  • "pr_branch": "string",
  • "pr_state": "string",
  • "pr_number": 0,
  • "pr_is_being_created": true,
  • "pr_error": "string",
  • "current_task": "string",
  • "result_diff": "string",
  • "sha": "string",
  • "merge_commit_sha": "string",
  • "merge_commit_error": "string",
  • "merge_commit_is_being_created": true,
  • "base_deploy_id": "string",
  • "attached_file_keys": [
    ],
  • "active_session_created_at": "string",
  • "has_result_diff": true,
  • "latest_session_deploy_id": "string",
  • "latest_session_deploy_url": "string",
  • "preview_state": "string",
  • "user": {
    }
}

createSiteAgentRunner: Start an agent run on a site

Starts an agent run on the site.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

The site's ID or one of its hostnames.

Request Body schema: application/json
prompt
required
string
branch
string

Branch to start from. Defaults to the site's production branch.

deploy_id
string

Deploy to start from. Takes precedence over branch.

agent
string

Agent to run, for example claude or codex.

model
string

Model for the agent to use. Omit to let Netlify choose.

effort
string
Enum: "low" "medium" "high"

Reasoning effort. Omit to let the agent decide.

mode
string
Enum: "normal" "ask"

normal (the default) changes code; ask answers questions without changing code.

Responses

Request samples

Content type
application/json
{
  • "prompt": "string",
  • "branch": "string",
  • "deploy_id": "string",
  • "agent": "string",
  • "model": "string",
  • "effort": "low",
  • "mode": "normal"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "parent_agent_runner_id": "string",
  • "state": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "done_at": "string",
  • "title": "string",
  • "branch": "string",
  • "result_branch": "string",
  • "pr_url": "string",
  • "pr_branch": "string",
  • "pr_state": "string",
  • "pr_number": 0,
  • "pr_is_being_created": true,
  • "pr_error": "string",
  • "current_task": "string",
  • "result_diff": "string",
  • "sha": "string",
  • "merge_commit_sha": "string",
  • "merge_commit_error": "string",
  • "merge_commit_is_being_created": true,
  • "base_deploy_id": "string",
  • "attached_file_keys": [
    ],
  • "active_session_created_at": "string",
  • "has_result_diff": true,
  • "latest_session_deploy_id": "string",
  • "latest_session_deploy_url": "string",
  • "preview_state": "string",
  • "user": {
    }
}

getAgentRunner: Get an agent run

Authorizations:
netlifyAuth
path Parameters
agent_runner_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "parent_agent_runner_id": "string",
  • "state": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "done_at": "string",
  • "title": "string",
  • "branch": "string",
  • "result_branch": "string",
  • "pr_url": "string",
  • "pr_branch": "string",
  • "pr_state": "string",
  • "pr_number": 0,
  • "pr_is_being_created": true,
  • "pr_error": "string",
  • "current_task": "string",
  • "result_diff": "string",
  • "sha": "string",
  • "merge_commit_sha": "string",
  • "merge_commit_error": "string",
  • "merge_commit_is_being_created": true,
  • "base_deploy_id": "string",
  • "attached_file_keys": [
    ],
  • "active_session_created_at": "string",
  • "has_result_diff": true,
  • "latest_session_deploy_id": "string",
  • "latest_session_deploy_url": "string",
  • "preview_state": "string",
  • "user": {
    }
}

getAgentRunnerDiff: Get an agent run's diff

Returns the run's changes as a unified diff. With page, returns that page of changed files and sets pagination headers.

Authorizations:
netlifyAuth
path Parameters
agent_runner_id
required
string
query Parameters
page
integer <int32>
per_page
integer <int32>
strip_binary
boolean

Replace binary file contents with a placeholder, keeping the file headers.

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

listAgentRunners: List a site's agent runs

Lists a site's agent runs, most recently active first. Archived runs are left out unless state is archived.

Authorizations:
netlifyAuth
query Parameters
site_id
required
string
account_id
required
string
page
integer <int32>
per_page
integer <int32>
state
string

Only runs in this state: new, running, await_input, interrupted, error, done, cancelled or archived.

title
string
branch
string
result_branch
string
user_id
string

Only runs started by this user.

from
integer

Unix timestamp. Only runs created at or after this time.

to
integer

Unix timestamp. Only runs created before this time.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

stopAgentRunner: Stop an agent run

Stops the run's active session. Stopping happens in the background.

Authorizations:
netlifyAuth
path Parameters
agent_runner_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

updateAgentRunner: Update an agent run

Authorizations:
netlifyAuth
path Parameters
agent_runner_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "parent_agent_runner_id": "string",
  • "state": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "done_at": "string",
  • "title": "string",
  • "branch": "string",
  • "result_branch": "string",
  • "pr_url": "string",
  • "pr_branch": "string",
  • "pr_state": "string",
  • "pr_number": 0,
  • "pr_is_being_created": true,
  • "pr_error": "string",
  • "current_task": "string",
  • "result_diff": "string",
  • "sha": "string",
  • "merge_commit_sha": "string",
  • "merge_commit_error": "string",
  • "merge_commit_is_being_created": true,
  • "base_deploy_id": "string",
  • "attached_file_keys": [
    ],
  • "active_session_created_at": "string",
  • "has_result_diff": true,
  • "latest_session_deploy_id": "string",
  • "latest_session_deploy_url": "string",
  • "preview_state": "string",
  • "user": {
    }
}

Agent runner session

answerAgentRunnerSession: Answer an agent run session's pending interaction

Answers or skips a pending interaction and resumes the session. A session waiting on an interaction is in the await_input state.

Authorizations:
netlifyAuth
path Parameters
agent_runner_id
required
string
agent_runner_session_id
required
string
Request Body schema: application/json
refId
required
string

Key of the pending interaction in the session's interactions.

response
Array of any

One entry per question in the interaction's payload: a string, an array of strings for a multi-select question, or null to skip that question.

skipped
boolean

Skip the whole interaction instead of answering it.

instruction
string

Instruction for the agent when skipping.

Responses

Request samples

Content type
application/json
{
  • "refId": "string",
  • "response": [
    ],
  • "skipped": true,
  • "instruction": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "agent_runner_id": "string",
  • "dev_server_id": "string",
  • "state": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "done_at": "string",
  • "paused_at": "string",
  • "title": "string",
  • "prompt": "string",
  • "agent_config": {
    },
  • "result": "string",
  • "result_diff": "string",
  • "commit_sha": "string",
  • "deploy_id": "string",
  • "deploy_url": "string",
  • "duration": 0,
  • "usage": {
    },
  • "interactions": {
    },
  • "steps": [
    ],
  • "user": {
    },
  • "attached_file_keys": [
    ],
  • "result_zip_file_name": "string",
  • "is_published": true
}

createAgentRunnerSession: Start a follow-up agent run session

Starts a follow-up session on the run.

Authorizations:
netlifyAuth
path Parameters
agent_runner_id
required
string
query Parameters
prompt
string

Use the request body instead.

agent
string

Use the request body instead.

model
string

Use the request body instead.

file_keys
Array of strings

Use the request body instead.

Request Body schema: application/json
prompt
string

What the agent should do. Required.

agent
string
model
string

Model for the agent to use. Omit to let Netlify choose.

mode
string
Enum: "normal" "ask"

normal (the default) changes code; ask answers questions without changing code.

Responses

Request samples

Content type
application/json
{
  • "prompt": "string",
  • "agent": "string",
  • "model": "string",
  • "mode": "normal"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "agent_runner_id": "string",
  • "dev_server_id": "string",
  • "state": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "done_at": "string",
  • "paused_at": "string",
  • "title": "string",
  • "prompt": "string",
  • "agent_config": {
    },
  • "result": "string",
  • "result_diff": "string",
  • "commit_sha": "string",
  • "deploy_id": "string",
  • "deploy_url": "string",
  • "duration": 0,
  • "usage": {
    },
  • "interactions": {
    },
  • "steps": [
    ],
  • "user": {
    },
  • "attached_file_keys": [
    ],
  • "result_zip_file_name": "string",
  • "is_published": true
}

getAgentRunnerSession: Get an agent run session

Authorizations:
netlifyAuth
path Parameters
agent_runner_id
required
string
agent_runner_session_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "agent_runner_id": "string",
  • "dev_server_id": "string",
  • "state": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "done_at": "string",
  • "paused_at": "string",
  • "title": "string",
  • "prompt": "string",
  • "agent_config": {
    },
  • "result": "string",
  • "result_diff": "string",
  • "commit_sha": "string",
  • "deploy_id": "string",
  • "deploy_url": "string",
  • "duration": 0,
  • "usage": {
    },
  • "interactions": {
    },
  • "steps": [
    ],
  • "user": {
    },
  • "attached_file_keys": [
    ],
  • "result_zip_file_name": "string",
  • "is_published": true
}

listAgentRunnerSessions: List an agent run's sessions

Authorizations:
netlifyAuth
path Parameters
agent_runner_id
required
string
query Parameters
page
integer <int32>
per_page
integer <int32>
state
string

Only sessions in this state: new, running, await_input, interrupted, error, done or cancelled.

from
integer

Unix timestamp. Only sessions created at or after this time.

to
integer

Unix timestamp. Only sessions created before this time.

order_by
string
Enum: "asc" "desc"

Responses

Response samples

Content type
application/json
[
  • {
    }
]

stopAgentRunnerSession: Stop an agent run session

Stops the session. Stopping happens in the background.

Authorizations:
netlifyAuth
path Parameters
agent_runner_id
required
string
agent_runner_session_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

updateAgentRunnerSession: Update an agent run session

Authorizations:
netlifyAuth
path Parameters
agent_runner_id
required
string
agent_runner_session_id
required
string
query Parameters
is_published
boolean

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "agent_runner_id": "string",
  • "dev_server_id": "string",
  • "state": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "done_at": "string",
  • "paused_at": "string",
  • "title": "string",
  • "prompt": "string",
  • "agent_config": {
    },
  • "result": "string",
  • "result_diff": "string",
  • "commit_sha": "string",
  • "deploy_id": "string",
  • "deploy_url": "string",
  • "duration": 0,
  • "usage": {
    },
  • "interactions": {
    },
  • "steps": [
    ],
  • "user": {
    },
  • "attached_file_keys": [
    ],
  • "result_zip_file_name": "string",
  • "is_published": true
}

Hook

createHookBySiteId: Create an outgoing hook

Authorizations:
netlifyAuth
query Parameters
site_id
required
string
Request Body schema: application/json
id
string
site_id
string
type
string
event
string
data
object
created_at
string <dateTime>
updated_at
string <dateTime>
disabled
boolean

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "type": "string",
  • "event": "string",
  • "data": { },
  • "created_at": "string",
  • "updated_at": "string",
  • "disabled": true
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "type": "string",
  • "event": "string",
  • "data": { },
  • "created_at": "string",
  • "updated_at": "string",
  • "disabled": true
}

deleteHook: Delete an outgoing hook

Authorizations:
netlifyAuth
path Parameters
hook_id
required
string

Responses

enableHook: Re-enable an outgoing hook

Re-enables an outgoing hook that was disabled after repeated delivery errors.

Authorizations:
netlifyAuth
path Parameters
hook_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "type": "string",
  • "event": "string",
  • "data": { },
  • "created_at": "string",
  • "updated_at": "string",
  • "disabled": true
}

getHook: Get an outgoing hook

Authorizations:
netlifyAuth
path Parameters
hook_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "type": "string",
  • "event": "string",
  • "data": { },
  • "created_at": "string",
  • "updated_at": "string",
  • "disabled": true
}

listHooksBySiteId: List a site's outgoing hooks

Returns the outgoing hooks for a site. Pass form_id or event to filter the results.

Authorizations:
netlifyAuth
query Parameters
site_id
required
string
form_id
string

Only return hooks attached to this form.

event
string

Only return hooks for this event name.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

updateHook: Update an outgoing hook

Authorizations:
netlifyAuth
path Parameters
hook_id
required
string
Request Body schema: application/json
id
string
site_id
string
type
string
event
string
data
object
created_at
string <dateTime>
updated_at
string <dateTime>
disabled
boolean

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "type": "string",
  • "event": "string",
  • "data": { },
  • "created_at": "string",
  • "updated_at": "string",
  • "disabled": true
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "type": "string",
  • "event": "string",
  • "data": { },
  • "created_at": "string",
  • "updated_at": "string",
  • "disabled": true
}

Hook type

listHookTypes: List outgoing hook types

Returns the available outgoing hook types. When site_id is given, returns only the types available to that site.

Authorizations:
netlifyAuth
query Parameters
site_id
string

Only return the hook types available to this site.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Build hook

createSiteBuildHook: Create a build hook

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
Request Body schema: application/json
title
string
branch
string

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "branch": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "title": "string",
  • "branch": "string",
  • "url": "string",
  • "site_id": "string",
  • "created_at": "string"
}

deleteSiteBuildHook: Delete a build hook

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

getSiteBuildHook: Get a build hook

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "title": "string",
  • "branch": "string",
  • "url": "string",
  • "site_id": "string",
  • "created_at": "string"
}

listSiteBuildHooks: List a site's build hooks

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

updateSiteBuildHook: Update a build hook

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
id
required
string
Request Body schema: application/json
title
string
branch
string

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "branch": "string"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Dev server hook

createSiteDevServerHook: Create a dev server hook

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
Request Body schema: application/json
title
string
branch
string
type
string
Enum: "new_dev_server" "content_refresh"

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "branch": "string",
  • "type": "new_dev_server"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "title": "string",
  • "branch": "string",
  • "url": "string",
  • "site_id": "string",
  • "created_at": "string",
  • "type": "new_dev_server"
}

deleteSiteDevServerHook: Delete a dev server hook

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

getSiteDevServerHook: Get a dev server hook

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "title": "string",
  • "branch": "string",
  • "url": "string",
  • "site_id": "string",
  • "created_at": "string",
  • "type": "new_dev_server"
}

listSiteDevServerHooks: List a site's dev server hooks

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

updateSiteDevServerHook: Update a dev server hook

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
id
required
string
Request Body schema: application/json
title
string
branch
string
type
string
Enum: "new_dev_server" "content_refresh"

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "branch": "string",
  • "type": "new_dev_server"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Service

getServices: List add-on services

Authorizations:
netlifyAuth
query Parameters
search
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

showService: Get an add-on service

Authorizations:
netlifyAuth
path Parameters
addonName
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "slug": "string",
  • "service_path": "string",
  • "long_description": "string",
  • "description": "string",
  • "events": [
    ],
  • "tags": [
    ],
  • "icon": "string",
  • "manifest_url": "string",
  • "environments": [
    ],
  • "created_at": "string",
  • "updated_at": "string"
}

showServiceManifest: Get an add-on service's manifest

Authorizations:
netlifyAuth
path Parameters
addonName
required
string

Responses

Response samples

Content type
application/json
{ }

Service instance

createServiceInstance: Create an add-on instance

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
addon
required
string
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "id": "string",
  • "url": "string",
  • "config": { },
  • "external_attributes": { },
  • "service_slug": "string",
  • "service_path": "string",
  • "service_name": "string",
  • "env": { },
  • "snippets": [
    ],
  • "auth_url": "string",
  • "created_at": "string",
  • "updated_at": "string"
}

deleteServiceInstance: Delete an add-on instance

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
addon
required
string
instance_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

listServiceInstancesForSite: List a site's add-on instances

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

showServiceInstance: Get an add-on instance

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
addon
required
string
instance_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "url": "string",
  • "config": { },
  • "external_attributes": { },
  • "service_slug": "string",
  • "service_path": "string",
  • "service_name": "string",
  • "env": { },
  • "snippets": [
    ],
  • "auth_url": "string",
  • "created_at": "string",
  • "updated_at": "string"
}

updateServiceInstance: Update an add-on instance

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
addon
required
string
instance_id
required
string
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Function

searchSiteFunctions: Search a site's functions

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
filter
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

uploadDeployFunction: Upload a deploy function

Authorizations:
netlifyAuth
path Parameters
deploy_id
required
string
name
required
string
query Parameters
runtime
string
invocation_mode
string
timeout
integer
size
integer
header Parameters
X-Nf-Retry-Count
integer
Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "sha": "string",
  • "region": "string"
}

Database

clearSiteDatabaseComputeSettings: Reset database compute settings to defaults

Resets project-level compute settings to tier defaults. Requires a Pro or higher plan.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

createSiteDatabase: Create a site database

Creates a new database for the specified site. If a database already exists, returns the existing connection string. The database region defaults to the site's functions region if not specified.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
Request Body schema: application/json
region
string

The region where the database should be created. Defaults to the site's functions region if not specified.

Responses

Request samples

Content type
application/json
{
  • "region": "string"
}

Response samples

Content type
application/json
{
  • "connection_string": "string"
}

createSiteDatabaseBranch: Create a database branch

Creates a new database branch. If a branch already exists for the specified branch ID, returns the existing connection string.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
Request Body schema: application/json
branch_id
required
string

The branch identifier

parent_branch_id
string

The ID of the parent branch to create the new branch from. Defaults to the production branch if not specified.

object

Arbitrary metadata to associate with the branch

Responses

Request samples

Content type
application/json
{
  • "parent_branch_id": "string",
  • "branch_id": "string",
  • "metadata": { }
}

Response samples

Content type
application/json
{
  • "connection_string": "string",
  • "metadata": { }
}

createSiteDatabaseSnapshot: Create a database snapshot

Creates a point-in-time snapshot of a database branch. Defaults to the production branch if no branch name is specified.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
Request Body schema: application/json
branch_id
string

The ID of the branch to snapshot. Defaults to "production" if not specified.

name
string

A name for the snapshot

object (databaseSnapshotMetadata)

Metadata associated with a snapshot

Responses

Request samples

Content type
application/json
{
  • "branch_id": "string",
  • "name": "string",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "source_branch_id": "string",
  • "manual": true,
  • "created_at": "string",
  • "expires_at": "string",
  • "timestamp": "string",
  • "metadata": {
    }
}

deleteSiteDatabase: Delete a site database

Deletes the database and all associated branches and snapshots for the specified site.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

deleteSiteDatabaseBranch: Delete a database branch

Deletes a database branch.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
branch_id
required
string

The branch ID

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

deleteSiteDatabaseSnapshot: Delete a database snapshot

Deletes a database snapshot.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
snapshot_id
required
string

The snapshot ID

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

getSiteDatabase: Get a site database

Returns the database connection string for the specified site.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
role
string
Enum: "netlifydb_owner" "netlifydb_readonly"

The database role to use for the connection string. Defaults to netlifydb_owner if not specified.

Responses

Response samples

Content type
application/json
{
  • "connection_string": "string"
}

getSiteDatabaseBranch: Get a database branch

Returns the database branch connection string for a specific branch.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
branch_id
required
string

The branch ID

query Parameters
role
string
Enum: "netlifydb_owner" "netlifydb_readonly"

The database role to use for the connection string. Defaults to netlifydb_owner if not specified.

Responses

Response samples

Content type
application/json
{
  • "connection_string": "string",
  • "metadata": { }
}

getSiteDatabaseComputeSettings: Get database compute settings

Returns the project-level compute settings for the database. Returns effective settings (custom or tier defaults). Requires a Pro or higher plan.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
{
  • "min_cu": 0,
  • "max_cu": 0,
  • "sleep_timeout_seconds": 0
}

getSiteDatabaseMigration: Get a database migration

Returns the contents of a named migration for the specified branch.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
name
required
string

The migration name

query Parameters
branch
string

The branch ID to look up the migration on. Defaults to the currently published deploy's branch.

Responses

Response samples

Content type
application/json
{
  • "version": 0,
  • "name": "string",
  • "path": "string",
  • "content": "string"
}

listSiteDatabaseBranches: List database branches

Returns all branches for the site's database with compute status and metadata.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
{
  • "branches": [
    ]
}

listSiteDatabaseMigrations: List database migrations

Returns the list of migrations available for the specified branch, indicating which ones have been applied to the database.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
branch
string

The branch ID to list migrations for. Defaults to "production" if not specified.

Responses

Response samples

Content type
application/json
{
  • "migrations": [
    ]
}

listSiteDatabaseSnapshots: List database snapshots

Returns all snapshots for the site's database.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
{
  • "snapshots": [
    ]
}

resetSiteDatabaseBranch: Reset a database branch

Resets a non-production database branch by re-forking it from a source branch (defaults to the production branch). If the target branch is already in sync with the source, returns the existing connection string without performing a reset, unless force=true is passed. The production branch cannot be reset.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
branch_id
required
string

The branch ID to reset

query Parameters
force
boolean

If true, resets the branch even when it is already in sync with the source.

role
string
Enum: "netlifydb_owner" "netlifydb_readonly"

The database role to use for the returned connection string. Defaults to netlifydb_owner if not specified.

Request Body schema: application/json
source_branch_id
string

The ID of the branch to re-fork the target branch from. Defaults to "production" if not specified.

Responses

Request samples

Content type
application/json
{
  • "source_branch_id": "string"
}

Response samples

Content type
application/json
{
  • "reset": true,
  • "connection_string": "string",
  • "metadata": { }
}

restoreSiteDatabaseSnapshot: Restore a database snapshot

Restores a snapshot to a database branch. Defaults to the production branch if no branch_name is specified.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
snapshot_id
required
string

The snapshot ID to restore

Request Body schema: application/json
branch_id
string

The ID of the branch to restore the snapshot to. Defaults to "production" if not specified.

Responses

Request samples

Content type
application/json
{
  • "branch_id": "string"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

runSiteDatabaseMigrations: Run database migrations for a deploy

Runs database migrations for the specified deploy. Finds the deploy and determines the appropriate branch.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
deploy_id
required
string

The deploy ID to run migrations for

Request Body schema: application/json
dry_run
boolean

If true, validates migrations without applying them.

Responses

Request samples

Content type
application/json
{
  • "dry_run": true
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

setSiteDatabaseBranchComputeSettings: Set a database branch's compute settings

Sets compute settings for a specific database branch, overriding project-level settings. Requires a Pro or higher plan.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
branch_id
required
string

The branch ID

Request Body schema: application/json
min_cu
number or null <double> [ 0.25 .. 16 ]

Minimum compute units (0.25 to 16.0). Must be less than or equal to max_cu.

max_cu
number or null <double> [ 0.25 .. 16 ]

Maximum compute units (0.25 to 16.0). Must be greater than or equal to min_cu. max_cu - min_cu must not exceed 8.0.

sleep_timeout_seconds
integer or null <int64> >= -1

Seconds of inactivity before the compute endpoint is suspended. Use -1 for always on, or a non-negative value.

Responses

Request samples

Content type
application/json
{
  • "min_cu": 0.25,
  • "max_cu": 0.25,
  • "sleep_timeout_seconds": -1
}

Response samples

Content type
application/json
{
  • "min_cu": 0,
  • "max_cu": 0,
  • "sleep_timeout_seconds": 0
}

setSiteDatabaseComputeSettings: Set database compute settings

Sets project-level compute settings for the database. Applied to new branches. Can be overridden per-branch. Requires a Pro or higher plan.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
Request Body schema: application/json
min_cu
number or null <double> [ 0.25 .. 16 ]

Minimum compute units (0.25 to 16.0). Must be less than or equal to max_cu.

max_cu
number or null <double> [ 0.25 .. 16 ]

Maximum compute units (0.25 to 16.0). Must be greater than or equal to min_cu. max_cu - min_cu must not exceed 8.0.

sleep_timeout_seconds
integer or null <int64> >= -1

Seconds of inactivity before the compute endpoint is suspended. Use -1 for always on, or a non-negative value.

Responses

Request samples

Content type
application/json
{
  • "min_cu": 0.25,
  • "max_cu": 0.25,
  • "sleep_timeout_seconds": -1
}

Response samples

Content type
application/json
{
  • "min_cu": 0,
  • "max_cu": 0,
  • "sleep_timeout_seconds": 0
}

Form

deleteSiteForm: Delete a form

Deletes a form and all of its submissions.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
form_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

listSiteForms: List a site's forms

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Form submission

deleteSubmission: Delete a form submission

Authorizations:
netlifyAuth
path Parameters
submission_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

listFormSubmission: Get a form submission

Authorizations:
netlifyAuth
path Parameters
submission_id
required
string
query Parameters
query
string
page
integer <int32>
per_page
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

listFormSubmissions: List a form's submissions

Authorizations:
netlifyAuth
path Parameters
form_id
required
string
query Parameters
page
integer <int32>
per_page
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

listSiteSubmissions: List a site's form submissions

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
page
integer <int32>
per_page
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Split test

createSplitTest: Create a split test

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
Request Body schema: application/json
branch_tests
object

Responses

Request samples

Content type
application/json
{
  • "branch_tests": { }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "name": "string",
  • "path": "string",
  • "branches": [
    ],
  • "active": true,
  • "created_at": "string",
  • "updated_at": "string",
  • "unpublished_at": "string"
}

disableSplitTest: Unpublish a split test

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
split_test_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

enableSplitTest: Publish a split test

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
split_test_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

getSplitTest: Get a split test

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
split_test_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "name": "string",
  • "path": "string",
  • "branches": [
    ],
  • "active": true,
  • "created_at": "string",
  • "updated_at": "string",
  • "unpublished_at": "string"
}

getSplitTests: List a site's split tests

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

updateSplitTest: Update a split test

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
split_test_id
required
string
Request Body schema: application/json
branch_tests
object

Responses

Request samples

Content type
application/json
{
  • "branch_tests": { }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "name": "string",
  • "path": "string",
  • "branches": [
    ],
  • "active": true,
  • "created_at": "string",
  • "updated_at": "string",
  • "unpublished_at": "string"
}

Asset

createSiteAsset: Create a site asset

This endpoint is only available to certain sites.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
query Parameters
name
required
string
size
required
integer <int64>
content_type
required
string
visibility
string

Responses

Response samples

Content type
application/json
{
  • "form": {
    },
  • "asset": {
    }
}

deleteSiteAsset: Delete a site asset

This endpoint is only available to certain sites.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
asset_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

getSiteAssetInfo: Get a site asset

This endpoint is only available to certain sites.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
asset_id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "creator_id": "string",
  • "name": "string",
  • "state": "string",
  • "content_type": "string",
  • "url": "string",
  • "key": "string",
  • "visibility": "string",
  • "size": 0,
  • "created_at": "string",
  • "updated_at": "string"
}

listSiteAssets: List a site's assets

This endpoint is only available to certain sites.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

updateSiteAsset: Update a site asset's state

This endpoint is only available to certain sites.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
asset_id
required
string
query Parameters
state
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "site_id": "string",
  • "creator_id": "string",
  • "name": "string",
  • "state": "string",
  • "content_type": "string",
  • "url": "string",
  • "key": "string",
  • "visibility": "string",
  • "size": 0,
  • "created_at": "string",
  • "updated_at": "string"
}

Asset public signature

getSiteAssetPublicSignature: Get a site asset's URL

Returns the URL of the asset. If the asset isn't publicly visible, returns a signed URL. This endpoint is only available to certain sites.

Authorizations:
netlifyAuth
path Parameters
site_id
required
string
asset_id
required
string

Responses

Response samples

Content type
application/json
{
  • "url": "string"
}