@netlify/open-api
Version:
Netlify's open-api definition as a module
1,550 lines (1,549 loc) • 573 kB
JSON
{
"swagger": "2.0",
"info": {
"version": "2.45.0",
"title": "Netlify's API documentation",
"description": "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.\n\nThis document is an OpenAPI reference for the Netlify API that you can explore. For more detailed instructions for common uses, please visit the [online documentation](https://www.netlify.com/docs/api/). Visit our Community forum to join the conversation about [understanding and using Netlify's API](https://community.netlify.com/t/common-issue-understanding-and-using-netlifys-api/160).\n\nAdditionally, we have two API clients for your convenience:\n- [Go Client](https://github.com/netlify/open-api#go-client)\n- [JS Client](https://github.com/netlify/build/tree/main/packages/js-client)",
"termsOfService": "https://www.netlify.com/legal/terms-of-use/",
"x-logo": {
"url": "netlify-logo.png",
"href": "https://www.netlify.com/docs/",
"altText": "Netlify"
}
},
"externalDocs": {
"url": "https://www.netlify.com/docs/api/",
"description": "Online documentation"
},
"securityDefinitions": {
"netlifyAuth": {
"type": "oauth2",
"flow": "implicit",
"authorizationUrl": "https://app.netlify.com/authorize"
}
},
"security": [
{
"netlifyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"responses": {
"error": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
},
"host": "api.netlify.com",
"basePath": "/api/v1",
"paths": {
"/sites": {
"get": {
"operationId": "listSites",
"tags": [
"site"
],
"parameters": [
{
"name": "name",
"in": "query",
"type": "string"
},
{
"name": "filter",
"in": "query",
"type": "string",
"enum": [
"all",
"owner",
"guest"
]
},
{
"type": "integer",
"format": "int32",
"name": "page",
"required": false,
"in": "query"
},
{
"type": "integer",
"format": "int32",
"name": "per_page",
"required": false,
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"state": {
"type": "string"
},
"plan": {
"type": "string"
},
"name": {
"type": "string"
},
"custom_domain": {
"type": "string"
},
"domain_aliases": {
"type": "array",
"items": {
"type": "string"
}
},
"branch_deploy_custom_domain": {
"type": "string"
},
"deploy_preview_custom_domain": {
"type": "string"
},
"password": {
"type": "string"
},
"notification_email": {
"type": "string"
},
"url": {
"type": "string"
},
"ssl_url": {
"type": "string"
},
"admin_url": {
"type": "string"
},
"screenshot_url": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "dateTime"
},
"updated_at": {
"type": "string",
"format": "dateTime"
},
"user_id": {
"type": "string"
},
"session_id": {
"type": "string"
},
"ssl": {
"type": "boolean"
},
"force_ssl": {
"type": "boolean"
},
"managed_dns": {
"type": "boolean"
},
"deploy_url": {
"type": "string"
},
"published_deploy": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"site_id": {
"type": "string"
},
"user_id": {
"type": "string"
},
"build_id": {
"type": "string"
},
"state": {
"type": "string"
},
"name": {
"type": "string"
},
"url": {
"type": "string"
},
"ssl_url": {
"type": "string"
},
"admin_url": {
"type": "string"
},
"deploy_url": {
"type": "string"
},
"deploy_ssl_url": {
"type": "string"
},
"screenshot_url": {
"type": "string"
},
"review_id": {
"type": "number"
},
"draft": {
"type": "boolean"
},
"required": {
"type": "array",
"items": {
"type": "string"
}
},
"required_functions": {
"type": "array",
"items": {
"type": "string"
}
},
"error_message": {
"type": "string"
},
"branch": {
"type": "string"
},
"commit_ref": {
"type": "string"
},
"commit_url": {
"type": "string"
},
"skipped": {
"type": "boolean"
},
"created_at": {
"type": "string",
"format": "dateTime"
},
"updated_at": {
"type": "string",
"format": "dateTime"
},
"published_at": {
"type": "string",
"format": "dateTime"
},
"title": {
"type": "string"
},
"context": {
"type": "string"
},
"locked": {
"type": "boolean"
},
"review_url": {
"type": "string"
},
"framework": {
"type": "string"
},
"skew_protection_token": {
"type": "string"
},
"function_schedules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"cron": {
"type": "string"
}
}
}
}
}
},
"account_id": {
"type": "string"
},
"account_name": {
"type": "string"
},
"account_slug": {
"type": "string"
},
"git_provider": {
"type": "string"
},
"deploy_hook": {
"type": "string"
},
"capabilities": {
"type": "object",
"additionalProperties": {
"type": "object"
}
},
"processing_settings": {
"type": "object",
"properties": {
"html": {
"type": "object",
"properties": {
"pretty_urls": {
"type": "boolean"
}
}
}
}
},
"build_settings": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"provider": {
"type": "string"
},
"deploy_key_id": {
"type": "string"
},
"repo_path": {
"type": "string"
},
"repo_branch": {
"type": "string"
},
"dir": {
"type": "string"
},
"functions_dir": {
"type": "string"
},
"cmd": {
"type": "string"
},
"allowed_branches": {
"type": "array",
"items": {
"type": "string"
}
},
"public_repo": {
"type": "boolean"
},
"private_logs": {
"type": "boolean"
},
"repo_url": {
"type": "string"
},
"env": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"installation_id": {
"type": "integer"
},
"stop_builds": {
"type": "boolean"
}
}
},
"id_domain": {
"type": "string"
},
"default_hooks_data": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
}
}
},
"build_image": {
"type": "string"
},
"prerender": {
"type": "string"
},
"functions_region": {
"type": "string"
},
"prevent_non_git_prod_deploys": {
"type": "boolean",
"default": false
}
}
}
}
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
},
"description": "**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables."
},
"post": {
"operationId": "createSite",
"tags": [
"site"
],
"consumes": [
"application/json"
],
"parameters": [
{
"name": "site",
"in": "body",
"schema": {
"allOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"state": {
"type": "string"
},
"plan": {
"type": "string"
},
"name": {
"type": "string"
},
"custom_domain": {
"type": "string"
},
"domain_aliases": {
"type": "array",
"items": {
"type": "string"
}
},
"branch_deploy_custom_domain": {
"type": "string"
},
"deploy_preview_custom_domain": {
"type": "string"
},
"password": {
"type": "string"
},
"notification_email": {
"type": "string"
},
"url": {
"type": "string"
},
"ssl_url": {
"type": "string"
},
"admin_url": {
"type": "string"
},
"screenshot_url": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "dateTime"
},
"updated_at": {
"type": "string",
"format": "dateTime"
},
"user_id": {
"type": "string"
},
"session_id": {
"type": "string"
},
"ssl": {
"type": "boolean"
},
"force_ssl": {
"type": "boolean"
},
"managed_dns": {
"type": "boolean"
},
"deploy_url": {
"type": "string"
},
"published_deploy": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"site_id": {
"type": "string"
},
"user_id": {
"type": "string"
},
"build_id": {
"type": "string"
},
"state": {
"type": "string"
},
"name": {
"type": "string"
},
"url": {
"type": "string"
},
"ssl_url": {
"type": "string"
},
"admin_url": {
"type": "string"
},
"deploy_url": {
"type": "string"
},
"deploy_ssl_url": {
"type": "string"
},
"screenshot_url": {
"type": "string"
},
"review_id": {
"type": "number"
},
"draft": {
"type": "boolean"
},
"required": {
"type": "array",
"items": {
"type": "string"
}
},
"required_functions": {
"type": "array",
"items": {
"type": "string"
}
},
"error_message": {
"type": "string"
},
"branch": {
"type": "string"
},
"commit_ref": {
"type": "string"
},
"commit_url": {
"type": "string"
},
"skipped": {
"type": "boolean"
},
"created_at": {
"type": "string",
"format": "dateTime"
},
"updated_at": {
"type": "string",
"format": "dateTime"
},
"published_at": {
"type": "string",
"format": "dateTime"
},
"title": {
"type": "string"
},
"context": {
"type": "string"
},
"locked": {
"type": "boolean"
},
"review_url": {
"type": "string"
},
"framework": {
"type": "string"
},
"skew_protection_token": {
"type": "string"
},
"function_schedules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"cron": {
"type": "string"
}
}
}
}
}
},
"account_id": {
"type": "string"
},
"account_name": {
"type": "string"
},
"account_slug": {
"type": "string"
},
"git_provider": {
"type": "string"
},
"deploy_hook": {
"type": "string"
},
"capabilities": {
"type": "object",
"additionalProperties": {
"type": "object"
}
},
"processing_settings": {
"type": "object",
"properties": {
"html": {
"type": "object",
"properties": {
"pretty_urls": {
"type": "boolean"
}
}
}
}
},
"build_settings": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"provider": {
"type": "string"
},
"deploy_key_id": {
"type": "string"
},
"repo_path": {
"type": "string"
},
"repo_branch": {
"type": "string"
},
"dir": {
"type": "string"
},
"functions_dir": {
"type": "string"
},
"cmd": {
"type": "string"
},
"allowed_branches": {
"type": "array",
"items": {
"type": "string"
}
},
"public_repo": {
"type": "boolean"
},
"private_logs": {
"type": "boolean"
},
"repo_url": {
"type": "string"
},
"env": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"installation_id": {
"type": "integer"
},
"stop_builds": {
"type": "boolean"
}
}
},
"id_domain": {
"type": "string"
},
"default_hooks_data": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
}
}
},
"build_image": {
"type": "string"
},
"prerender": {
"type": "string"
},
"functions_region": {
"type": "string"
},
"prevent_non_git_prod_deploys": {
"type": "boolean",
"default": false
}
}
},
{
"properties": {
"repo": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"provider": {
"type": "string"
},
"deploy_key_id": {
"type": "string"
},
"repo_path": {
"type": "string"
},
"repo_branch": {
"type": "string"
},
"dir": {
"type": "string"
},
"functions_dir": {
"type": "string"
},
"cmd": {
"type": "string"
},
"allowed_branches": {
"type": "array",
"items": {
"type": "string"
}
},
"public_repo": {
"type": "boolean"
},
"private_logs": {
"type": "boolean"
},
"repo_url": {
"type": "string"
},
"env": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"installation_id": {
"type": "integer"
},
"stop_builds": {
"type": "boolean"
}
}
}
}
}
]
},
"required": true
},
{
"name": "configure_dns",
"type": "boolean",
"in": "query"
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"state": {
"type": "string"
},
"plan": {
"type": "string"
},
"name": {
"type": "string"
},
"custom_domain": {
"type": "string"
},
"domain_aliases": {
"type": "array",
"items": {
"type": "string"
}
},
"branch_deploy_custom_domain": {
"type": "string"
},
"deploy_preview_custom_domain": {
"type": "string"
},
"password": {
"type": "string"
},
"notification_email": {
"type": "string"
},
"url": {
"type": "string"
},
"ssl_url": {
"type": "string"
},
"admin_url": {
"type": "string"
},
"screenshot_url": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "dateTime"
},
"updated_at": {
"type": "string",
"format": "dateTime"
},
"user_id": {
"type": "string"
},
"session_id": {
"type": "string"
},
"ssl": {
"type": "boolean"
},
"force_ssl": {
"type": "boolean"
},
"managed_dns": {
"type": "boolean"
},
"deploy_url": {
"type": "string"
},
"published_deploy": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"site_id": {
"type": "string"
},
"user_id": {
"type": "string"
},
"build_id": {
"type": "string"
},
"state": {
"type": "string"
},
"name": {
"type": "string"
},
"url": {
"type": "string"
},
"ssl_url": {
"type": "string"
},
"admin_url": {
"type": "string"
},
"deploy_url": {
"type": "string"
},
"deploy_ssl_url": {
"type": "string"
},
"screenshot_url": {
"type": "string"
},
"review_id": {
"type": "number"
},
"draft": {
"type": "boolean"
},
"required": {
"type": "array",
"items": {
"type": "string"
}
},
"required_functions": {
"type": "array",
"items": {
"type": "string"
}
},
"error_message": {
"type": "string"
},
"branch": {
"type": "string"
},
"commit_ref": {
"type": "string"
},
"commit_url": {
"type": "string"
},
"skipped": {
"type": "boolean"
},
"created_at": {
"type": "string",
"format": "dateTime"
},
"updated_at": {
"type": "string",
"format": "dateTime"
},
"published_at": {
"type": "string",
"format": "dateTime"
},
"title": {
"type": "string"
},
"context": {
"type": "string"
},
"locked": {
"type": "boolean"
},
"review_url": {
"type": "string"
},
"framework": {
"type": "string"
},
"skew_protection_token": {
"type": "string"
},
"function_schedules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"cron": {
"type": "string"
}
}
}
}
}
},
"account_id": {
"type": "string"
},
"account_name": {
"type": "string"
},
"account_slug": {
"type": "string"
},
"git_provider": {
"type": "string"
},
"deploy_hook": {
"type": "string"
},
"capabilities": {
"type": "object",
"additionalProperties": {
"type": "object"
}
},
"processing_settings": {
"type": "object",
"properties": {
"html": {
"type": "object",
"properties": {
"pretty_urls": {
"type": "boolean"
}
}
}
}
},
"build_settings": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"provider": {
"type": "string"
},
"deploy_key_id": {
"type": "string"
},
"repo_path": {
"type": "string"
},
"repo_branch": {
"type": "string"
},
"dir": {
"type": "string"
},
"functions_dir": {
"type": "string"
},
"cmd": {
"type": "string"
},
"allowed_branches": {
"type": "array",
"items": {
"type": "string"
}
},
"public_repo": {
"type": "boolean"
},
"private_logs": {
"type": "boolean"
},
"repo_url": {
"type": "string"
},
"env": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"installation_id": {
"type": "integer"
},
"stop_builds": {
"type": "boolean"
}
}
},
"id_domain": {
"type": "string"
},
"default_hooks_data": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
}
}
},
"build_image": {
"type": "string"
},
"prerender": {
"type": "string"
},
"functions_region": {
"type": "string"
},
"prevent_non_git_prod_deploys": {
"type": "boolean",
"default": false
}
}
}
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
},
"description": "**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [createEnvVars](#tag/environmentVariables/operation/createEnvVars) to create environment variables for a site."
}
},
"/sites/{site_id}": {
"parameters": [
{
"name": "site_id",
"type": "string",
"in": "path",
"required": true
}
],
"get": {
"operationId": "getSite",
"tags": [
"site"
],
"parameters": [
{
"name": "feature_flags",
"x-internal": true,
"type": "string",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"state": {
"type": "string"
},
"plan": {
"type": "string"
},
"name": {
"type": "string"
},
"custom_domain": {
"type": "string"
},
"domain_aliases": {
"type": "array",
"items": {
"type": "string"
}
},
"branch_deploy_custom_domain": {
"type": "string"
},
"deploy_preview_custom_domain": {
"type": "string"
},
"password": {
"type": "string"
},
"notification_email": {
"type": "string"
},
"url": {
"type": "string"
},
"ssl_url": {
"type": "string"
},
"admin_url": {
"type": "string"
},
"screenshot_url": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "dateTime"
},
"updated_at": {
"type": "string",
"format": "dateTime"
},
"user_id": {
"type": "string"
},
"session_id": {
"type": "string"
},
"ssl": {
"type": "boolean"
},
"force_ssl": {
"type": "boolean"
},
"managed_dns": {
"type": "boolean"
},
"deploy_url": {
"type": "string"
},
"published_deploy": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"site_id": {
"type": "string"
},
"user_id": {
"type": "string"
},
"build_id": {
"type": "string"
},
"state": {
"type": "string"
},
"name": {
"type": "string"
},
"url": {
"type": "string"
},
"ssl_url": {
"type": "string"
},
"admin_url": {
"type": "string"
},
"deploy_url": {
"type": "string"
},
"deploy_ssl_url": {
"type": "string"
},
"screenshot_url": {
"type": "string"
},
"review_id": {
"type": "number"
},
"draft": {
"type": "boolean"
},
"required": {
"type": "array",
"items": {
"type": "string"
}
},
"required_functions": {
"type": "array",
"items": {
"type": "string"
}
},
"error_message": {
"type": "string"
},
"branch": {
"type": "string"
},
"commit_ref": {
"type": "string"
},
"commit_url": {
"type": "string"
},
"skipped": {
"type": "boolean"
},
"created_at": {
"type": "string",
"format": "dateTime"
},
"updated_at": {
"type": "string",
"format": "dateTime"
},
"published_at": {
"type": "string",
"format": "dateTime"
},
"title": {
"type": "string"
},
"context": {
"type": "string"
},
"locked": {
"type": "boolean"
},
"review_url": {
"type": "string"
},
"framework": {
"type": "string"
},
"skew_protection_token": {
"type": "string"
},
"function_schedules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"cron": {
"type": "string"
}
}
}
}
}
},
"account_id": {
"type": "string"
},
"account_name": {
"type": "string"
},
"account_slug": {
"type": "string"
},
"git_provider": {
"type": "string"
},
"deploy_hook": {
"type": "string"
},
"capabilities": {
"type": "object",
"additionalProperties": {
"type": "object"
}
},
"processing_settings": {
"type": "object",
"properties": {
"html": {
"type": "object",
"properties": {
"pretty_urls": {
"type": "boolean"
}
}
}
}
},
"build_settings": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"provider": {
"type": "string"
},
"deploy_key_id": {
"type": "string"
},
"repo_path": {
"type": "string"
},
"repo_branch": {
"type": "string"
},
"dir": {
"type": "string"
},
"functions_dir": {
"type": "string"
},
"cmd": {
"type": "string"
},
"allowed_branches": {
"type": "array",
"items": {
"type": "string"
}
},
"public_repo": {
"type": "boolean"
},
"private_logs": {
"type": "boolean"
},
"repo_url": {
"type": "string"
},
"env": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"installation_id": {
"type": "integer"
},
"stop_builds": {
"type": "boolean"
}
}
},
"id_domain": {
"type": "string"
},
"default_hooks_data": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
}
}
},
"build_image": {
"type": "string"
},
"prerender": {
"type": "string"
},
"functions_region": {
"type": "string"
},
"prevent_non_git_prod_deploys": {
"type": "boolean",
"default": false
}
}
}
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
},
"description": "**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables."
},
"patch": {
"operationId": "updateSite",
"tags": [
"site"
],
"consumes": [
"application/json"
],
"parameters": [
{
"name": "site",
"in": "body",
"schema": {
"allOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"state": {
"type": "string"
},
"plan": {
"type": "string"
},
"name": {
"type": "string"
},
"custom_domain": {