A continuation of netlify_openapi_swagger.json. The complete source identity, every recorded occurrence, and linked equations are on its first page.
Source transcript · continued
Download complete source text ↓24,715 lines · 705.9 KB
}
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
},
"post": {
"x-internal": true,
"operationId": "createSiteAgentRunnerHook",
"tags": [
"agentRunnerHook"
],
"consumes": [
"application/json"
],
"parameters": [
{
"name": "agentRunnerHook",
"in": "body",
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"branch": {
"type": "string"
},
"prompt": {
"type": "string"
},
"agent": {
"type": "string"
}
}
},
"required": true
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"allOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"site_id": {
"type": "string"
},
"title": {
"type": "string"
},
"branch": {
"type": "string"
},
"prompt": {
"type": "string"
},
"agent": {
"type": "string"
},
"url": {
"type": "string"
},
"msg": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "dateTime"
}
}
},
{
"properties": {
"secret": {
"type": "string"
}
}
}
]
}
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
}
},
"/sites/{site_id}/agent_runner_hooks/{id}": {
"parameters": [
{
"name": "site_id",
"type": "string",
"in": "path",
"required": true
},
{
"name": "id",
"type": "string",
"in": "path",
"required": true
}
],
"get": {
"x-internal": true,
"operationId": "getSiteAgentRunnerHook",
"tags": [
"agentRunnerHook"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"site_id": {
"type": "string"
},
"title": {
"type": "string"
},
"branch": {
"type": "string"
},
"prompt": {
"type": "string"
},
"agent": {
"type": "string"
},
"url": {
"type": "string"
},
"msg": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "dateTime"
}
}
}
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
},
"put": {
"x-internal": true,
"operationId": "updateSiteAgentRunnerHook",
"tags": [
"agentRunnerHook"
],
"consumes": [
"application/json"
],
"parameters": [
{
"name": "agentRunnerHook",
"in": "body",
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"branch": {
"type": "string"
},
"prompt": {
"type": "string"
},
"agent": {
"type": "string"
}
}
},
"required": true
}
],
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
},
"delete": {
"x-internal": true,
"operationId": "deleteSiteAgentRunnerHook",
"tags": [
"agentRunnerHook"
],
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
}
},
"/ai-gateway/providers": {
"get": {
"operationId": "getAIGatewayProviders",
"tags": [
"aiGateway"
],
"security": [],
"responses": {
"200": {
"description": "The mapping of providers and supported models",
"schema": {
"type": "object",
"properties": {
"providers": {
"additionalProperties": {
"type": "object",
"properties": {
"token_env_var": {
"type": "string"
},
"url_env_var": {
"type": "string"
},
"models": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
}
},
"/sites/{site_id}/ai-gateway/token": {
"parameters": [
{
"name": "site_id",
"type": "string",
"in": "path",
"required": true,
"description": "The site ID"
}
],
"get": {
"operationId": "getAIGatewayToken",
"tags": [
"aiGateway"
],
"responses": {
"200": {
"description": "AI Gateway token for the site",
"schema": {
"type": "object",
"properties": {
"token": {
"type": "string",
"description": "The AI Gateway authentication token"
},
"url": {
"type": "string",
"description": "AI gateway base url"
},
"expires_at": {
"type": "integer",
"format": "int64",
"description": "Unix timestamp when the token expires"
}
}
}
},
"404": {
"description": "AI Gateway not available for this site"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
},
"description": "Returns an AI Gateway token for a specific site"
}
},
"/accounts/{account_id}/ai-gateway/token": {
"parameters": [
{
"name": "account_id",
"type": "string",
"in": "path",
"required": true,
"description": "The account ID"
}
],
"get": {
"operationId": "getAccountAIGatewayToken",
"tags": [
"aiGateway"
],
"responses": {
"200": {
"description": "AI Gateway token for the account",
"schema": {
"type": "object",
"properties": {
"token": {
"type": "string",
"description": "The AI Gateway authentication token"
},
"url": {
"type": "string",
"description": "AI gateway base url"
},
"expires_at": {
"type": "integer",
"format": "int64",
"description": "Unix timestamp when the token expires"
}
}
}
},
"404": {
"description": "AI Gateway not available for this account"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
},
"description": "Returns an AI Gateway token scoped to an account"
}
},
"/sites/{site_id}/database": {
"parameters": [
{
"name": "site_id",
"type": "string",
"in": "path",
"required": true
}
],
"post": {
"operationId": "createSiteDatabase",
"tags": [
"database"
],
"description": "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.",
"consumes": [
"application/json"
],
"parameters": [
{
"name": "database",
"in": "body",
"schema": {
"type": "object",
"description": "Request body for creating a database",
"properties": {
"region": {
"type": "string",
"description": "The region where the database should be created. Defaults to the site's functions region if not specified."
}
}
}
}
],
"responses": {
"200": {
"description": "Database already exists",
"schema": {
"type": "object",
"description": "Response containing the database connection string",
"properties": {
"connection_string": {
"type": "string",
"description": "The connection string for the database"
}
}
}
},
"201": {
"description": "Created",
"schema": {
"type": "object",
"description": "Response containing the database connection string",
"properties": {
"connection_string": {
"type": "string",
"description": "The connection string for the database"
}
}
}
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
},
"get": {
"operationId": "getSiteDatabase",
"tags": [
"database"
],
"description": "Returns the database connection string for the specified site.",
"parameters": [
{
"name": "role",
"type": "string",
"in": "query",
"description": "The database role to use for the connection string. Defaults to netlifydb_owner if not specified.",
"enum": [
"netlifydb_owner",
"netlifydb_readonly"
]
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"description": "Response containing the database connection string",
"properties": {
"connection_string": {
"type": "string",
"description": "The connection string for the database"
}
}
}
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
},
"delete": {
"operationId": "deleteSiteDatabase",
"tags": [
"database"
],
"description": "Deletes the database and all associated branches and snapshots for the specified site.",
"responses": {
"204": {
"description": "Deleted"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
}
},
"/sites/{site_id}/database/branch": {
"parameters": [
{
"name": "site_id",
"type": "string",
"in": "path",
"required": true
}
],
"post": {
"operationId": "createSiteDatabaseBranch",
"tags": [
"database"
],
"description": "Creates a new database branch. If a branch already exists for the specified branch ID, returns the existing connection string.",
"consumes": [
"application/json"
],
"parameters": [
{
"name": "branch",
"in": "body",
"schema": {
"type": "object",
"description": "Request body for creating a database branch",
"required": [
"branch_id"
],
"properties": {
"parent_branch_id": {
"type": "string",
"description": "The ID of the parent branch to create the new branch from. Defaults to the production branch if not specified."
},
"branch_id": {
"type": "string",
"description": "The branch identifier"
},
"metadata": {
"type": "object",
"description": "Arbitrary metadata to associate with the branch",
"additionalProperties": true
}
}
},
"required": true
}
],
"responses": {
"200": {
"description": "Branch already exists",
"schema": {
"type": "object",
"description": "Response containing the database branch connection string",
"properties": {
"connection_string": {
"type": "string",
"description": "The connection string for the database branch"
},
"metadata": {
"type": "object",
"description": "Metadata associated with the branch",
"additionalProperties": true
}
}
}
},
"201": {
"description": "Created",
"schema": {
"type": "object",
"description": "Response containing the database branch connection string",
"properties": {
"connection_string": {
"type": "string",
"description": "The connection string for the database branch"
},
"metadata": {
"type": "object",
"description": "Metadata associated with the branch",
"additionalProperties": true
}
}
}
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
}
},
"/sites/{site_id}/database/branches": {
"parameters": [
{
"name": "site_id",
"type": "string",
"in": "path",
"required": true
}
],
"get": {
"operationId": "listSiteDatabaseBranches",
"tags": [
"database"
],
"description": "Returns all branches for the site's database with compute status and metadata.",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"description": "Response containing a list of database branches",
"properties": {
"branches": {
"type": "array",
"items": {
"type": "object",
"description": "Detailed information about a database branch",
"properties": {
"branch_id": {
"type": "string",
"description": "The branch identifier"
},
"name": {
"type": "string",
"description": "The branch name"
},
"connection_string": {
"type": "string",
"description": "The connection string for the branch"
},
"state": {
"type": "string",
"description": "The current state of the branch",
"enum": [
"init",
"creating",
"resetting",
"ready",
"archived"
]
},
"logical_size_bytes": {
"type": "integer",
"format": "int64",
"description": "The logical size of the branch in bytes"
},
"created_at": {
"type": "string",
"format": "dateTime",
"description": "When the branch was created"
},
"updated_at": {
"type": "string",
"format": "dateTime",
"description": "When the branch was last updated"
},
"last_active_at": {
"type": "string",
"format": "dateTime",
"description": "When the branch was last active"
},
"compute": {
"type": "object",
"description": "Compute endpoint status for a branch",
"properties": {
"current_state": {
"type": "string",
"description": "The current state of the compute endpoint",
"enum": [
"active",
"idle"
]
},
"autoscaling_limit_min_cu": {
"type": "number",
"format": "double",
"description": "Minimum compute units for autoscaling"
},
"autoscaling_limit_max_cu": {
"type": "number",
"format": "double",
"description": "Maximum compute units for autoscaling"
},
"suspend_timeout_seconds": {
"type": "integer",
"format": "int64",
"description": "Seconds of inactivity before the compute endpoint is suspended"
},
"last_active": {
"type": "string",
"format": "dateTime",
"description": "When the compute endpoint was last active"
}
}
},
"metadata": {
"type": "object",
"description": "Metadata associated with the branch",
"additionalProperties": true
}
}
},
"description": "List of database branches"
}
}
}
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
}
},
"/sites/{site_id}/database/branch/{branch_id}": {
"parameters": [
{
"name": "site_id",
"type": "string",
"in": "path",
"required": true
},
{
"name": "branch_id",
"type": "string",
"in": "path",
"required": true,
"description": "The branch ID"
}
],
"get": {
"operationId": "getSiteDatabaseBranch",
"tags": [
"database"
],
"description": "Returns the database branch connection string for a specific branch.",
"parameters": [
{
"name": "role",
"type": "string",
"in": "query",
"description": "The database role to use for the connection string. Defaults to netlifydb_owner if not specified.",
"enum": [
"netlifydb_owner",
"netlifydb_readonly"
]
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"description": "Response containing the database branch connection string",
"properties": {
"connection_string": {
"type": "string",
"description": "The connection string for the database branch"
},
"metadata": {
"type": "object",
"description": "Metadata associated with the branch",
"additionalProperties": true
}
}
}
},
"404": {
"description": "Branch not found"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
},
"delete": {
"operationId": "deleteSiteDatabaseBranch",
"tags": [
"database"
],
"description": "Deletes a database branch.",
"responses": {
"204": {
"description": "Deleted"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
}
},
"/sites/{site_id}/database/branch/{branch_id}/reset": {
"parameters": [
{
"name": "site_id",
"type": "string",
"in": "path",
"required": true
},
{
"name": "branch_id",
"type": "string",
"in": "path",
"required": true,
"description": "The branch ID to reset"
}
],
"post": {
"operationId": "resetSiteDatabaseBranch",
"tags": [
"database"
],
"description": "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.",
"consumes": [
"application/json"
],
"parameters": [
{
"name": "force",
"type": "boolean",
"in": "query",
"description": "If true, resets the branch even when it is already in sync with the source."
},
{
"name": "role",
"type": "string",
"in": "query",
"description": "The database role to use for the returned connection string. Defaults to netlifydb_owner if not specified.",
"enum": [
"netlifydb_owner",
"netlifydb_readonly"
]
},
{
"name": "reset",
"in": "body",
"schema": {
"type": "object",
"description": "Request body for resetting a database branch",
"properties": {
"source_branch_id": {
"type": "string",
"description": "The ID of the branch to re-fork the target branch from. Defaults to \"production\" if not specified."
}
}
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"description": "Response for a database branch reset",
"properties": {
"reset": {
"type": "boolean",
"description": "Whether the branch was actually re-forked. False when the target was already in sync with the source and `force=true` was not set."
},
"connection_string": {
"type": "string",
"description": "The connection string for the reset (or unchanged) branch"
},
"metadata": {
"type": "object",
"description": "Metadata associated with the branch",
"additionalProperties": true
}
}
}
},
"400": {
"description": "Invalid request — for example, the target is the production branch or the source branch is the same as the target."
},
"404": {
"description": "Database or branch not found"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
}
},
"/sites/{site_id}/database/branch/{branch_id}/compute/settings": {
"parameters": [
{
"name": "site_id",
"type": "string",
"in": "path",
"required": true
},
{
"name": "branch_id",
"type": "string",
"in": "path",
"required": true,
"description": "The branch ID"
}
],
"put": {
"operationId": "setSiteDatabaseBranchComputeSettings",
"tags": [
"database"
],
"description": "Sets compute settings for a specific database branch, overriding project-level settings. Requires a Pro or higher plan.",
"consumes": [
"application/json"
],
"parameters": [
{
"name": "computeSettings",
"in": "body",
"schema": {
"type": "object",
"description": "Request body for setting compute settings. All fields are optional; only provided fields are updated.",
"properties": {
"min_cu": {
"type": "number",
"format": "double",
"minimum": 0.25,
"maximum": 16,
"x-nullable": true,
"description": "Minimum compute units (0.25 to 16.0). Must be less than or equal to max_cu."
},
"max_cu": {
"type": "number",
"format": "double",
"minimum": 0.25,
"maximum": 16,
"x-nullable": true,
"description": "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": {
"type": "integer",
"format": "int64",
"minimum": -1,
"x-nullable": true,
"description": "Seconds of inactivity before the compute endpoint is suspended. Use -1 for always on, or a non-negative value."
}
}
},
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"description": "Compute settings for a database or branch",
"properties": {
"min_cu": {
"type": "number",
"format": "double",
"description": "Minimum compute units"
},
"max_cu": {
"type": "number",
"format": "double",
"description": "Maximum compute units"
},
"sleep_timeout_seconds": {
"type": "integer",
"format": "int64",
"description": "Seconds of inactivity before suspension"
}
}
}
},
"403": {
"description": "Compute customization requires a Pro or higher plan"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
}
},
"/sites/{site_id}/database/compute/settings": {
"parameters": [
{
"name": "site_id",
"type": "string",
"in": "path",
"required": true
}
],
"put": {
"operationId": "setSiteDatabaseComputeSettings",
"tags": [
"database"
],
"description": "Sets project-level compute settings for the database. Applied to new branches. Can be overridden per-branch. Requires a Pro or higher plan.",
"consumes": [
"application/json"
],
"parameters": [
{
"name": "computeSettings",
"in": "body",
"schema": {
"type": "object",
"description": "Request body for setting compute settings. All fields are optional; only provided fields are updated.",
"properties": {
"min_cu": {
"type": "number",
"format": "double",
"minimum": 0.25,
"maximum": 16,
"x-nullable": true,
"description": "Minimum compute units (0.25 to 16.0). Must be less than or equal to max_cu."
},
"max_cu": {
"type": "number",
"format": "double",
"minimum": 0.25,
"maximum": 16,
"x-nullable": true,
"description": "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": {
"type": "integer",
"format": "int64",
"minimum": -1,
"x-nullable": true,
"description": "Seconds of inactivity before the compute endpoint is suspended. Use -1 for always on, or a non-negative value."
}
}
},
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"description": "Compute settings for a database or branch",
"properties": {
"min_cu": {
"type": "number",
"format": "double",
"description": "Minimum compute units"
},
"max_cu": {
"type": "number",
"format": "double",
"description": "Maximum compute units"
},
"sleep_timeout_seconds": {
"type": "integer",
"format": "int64",
"description": "Seconds of inactivity before suspension"
}
}
}
},
"403": {
"description": "Compute customization requires a Pro or higher plan"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
},
"get": {
"operationId": "getSiteDatabaseComputeSettings",
"tags": [
"database"
],
"description": "Returns the project-level compute settings for the database. Returns effective settings (custom or tier defaults). Requires a Pro or higher plan.",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"description": "Compute settings for a database or branch",
"properties": {
"min_cu": {
"type": "number",
"format": "double",
"description": "Minimum compute units"
},
"max_cu": {
"type": "number",
"format": "double",
"description": "Maximum compute units"
},
"sleep_timeout_seconds": {
"type": "integer",
"format": "int64",
"description": "Seconds of inactivity before suspension"
}
}
}
},
"403": {
"description": "Compute customization requires a Pro or higher plan"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
},
"delete": {
"operationId": "clearSiteDatabaseComputeSettings",
"tags": [
"database"
],
"description": "Resets project-level compute settings to tier defaults. Requires a Pro or higher plan.",
"responses": {
"204": {
"description": "Cleared"
},
"403": {
"description": "Compute customization requires a Pro or higher plan"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
}
},
"/sites/{site_id}/database/migrations": {
"parameters": [
{
"name": "site_id",
"type": "string",
"in": "path",
"required": true
}
],
"get": {
"operationId": "listSiteDatabaseMigrations",
"tags": [
"database"
],
"description": "Returns the list of migrations available for the specified branch, indicating which ones have been applied to the database.",
"parameters": [
{
"name": "branch",
"type": "string",
"in": "query",
"description": "The branch ID to list migrations for. Defaults to \"production\" if not specified."
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"description": "Response containing the list of migrations for a branch",
"properties": {
"migrations": {
"type": "array",
"items": {
"type": "object",
"description": "A migration available to a database branch",
"properties": {
"version": {
"type": "integer",
"format": "int64",
"description": "The migration version number"
},
"name": {
"type": "string",
"description": "The migration name"
},
"path": {
"type": "string",
"description": "The path to the migration file in the deploy bundle"
},
"applied": {
"type": "boolean",
"description": "Whether this migration has been applied to the branch"
}
}
},
"description": "List of migrations"
}
}
}
},
"404": {
"description": "Database or branch not found"
},
"423": {
"description": "Database is disabled"
},
"default": {
"description": "error",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string",
"x-nullable": false
}
}
}
}
}
}
},
"/sites/{site_id}/database/migrations/{name}": {