{
  "name": "CreateDeployment",
  "plane": "control",
  "terraformEligible": false,
  "protocol": {
    "kind": "cloudJson",
    "target": "CloudSites.CreateDeployment",
    "service": "sites"
  },
  "requestBody": "typed",
  "responseBody": "typed",
  "requestSchema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "additionalProperties": false,
    "definitions": {
      "ClientToken": {
        "type": "string"
      },
      "CsrfMode": {
        "enum": [
          "SAME_ORIGIN",
          "ORIGIN_ALLOWLIST",
          "DISABLED"
        ],
        "type": "string"
      },
      "CsrfPolicy": {
        "additionalProperties": false,
        "properties": {
          "allowedOrigins": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "mode": {
            "allOf": [
              {
                "$ref": "#/definitions/CsrfMode"
              }
            ],
            "default": "SAME_ORIGIN"
          }
        },
        "type": "object"
      },
      "DeploymentManifest": {
        "additionalProperties": false,
        "description": "Canonical SiteBundle shape accepted by CreateDeployment. Adapter metadata and origin routes are explicit so the public wire cannot select an arbitrary upstream.",
        "properties": {
          "adapterId": {
            "type": [
              "string",
              "null"
            ]
          },
          "adapterVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "assets": {
            "items": {
              "$ref": "#/definitions/ManifestAsset"
            },
            "type": "array"
          },
          "cleanUrls": {
            "default": false,
            "type": "boolean"
          },
          "contentDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "dynamicRedirects": {
            "items": {
              "$ref": "#/definitions/DynamicRedirectRule"
            },
            "type": "array"
          },
          "formRoutes": {
            "items": {
              "$ref": "#/definitions/FormRoute"
            },
            "type": "array"
          },
          "frameworkId": {
            "type": [
              "string",
              "null"
            ]
          },
          "frameworkVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "headers": {
            "items": {
              "$ref": "#/definitions/HeaderRule"
            },
            "type": "array"
          },
          "imageOptimization": {
            "default": false,
            "description": "Enables the bounded same-site `/_image` transform route.",
            "type": "boolean"
          },
          "imageSources": {
            "description": "Allowlisted private/public image sources for signed `/_image` fetches.",
            "items": {
              "$ref": "#/definitions/ImageSource"
            },
            "type": "array"
          },
          "isrTags": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "description": "Deployment-scoped ISR tag index: tag → normalized cache paths.",
            "type": "object"
          },
          "notFoundDocument": {
            "type": [
              "string",
              "null"
            ]
          },
          "originBindings": {
            "items": {
              "$ref": "#/definitions/OriginBinding"
            },
            "type": "array"
          },
          "redirects": {
            "items": {
              "$ref": "#/definitions/RedirectRule"
            },
            "type": "array"
          },
          "rewrites": {
            "items": true,
            "type": "array"
          },
          "runtimeProfile": {
            "$ref": "#/definitions/SitesRuntimeProfile"
          },
          "runtimeSecrets": {
            "additionalProperties": {
              "$ref": "#/definitions/RuntimeSecretRef"
            },
            "description": "Write-only Worker secret bindings resolved from **secrets** at publish. Values never appear in manifests, responses, digests, or logs.",
            "type": "object"
          },
          "schemaVersion": {
            "format": "uint32",
            "minimum": 0.0,
            "type": [
              "integer",
              "null"
            ]
          },
          "spaFallback": {
            "default": false,
            "type": "boolean"
          },
          "workerBundle": {
            "anyOf": [
              {
                "$ref": "#/definitions/WorkerBundle"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "assets",
          "runtimeProfile"
        ],
        "type": "object"
      },
      "DynamicPathPattern": {
        "additionalProperties": false,
        "properties": {
          "segments": {
            "items": {
              "$ref": "#/definitions/DynamicPathSegment"
            },
            "type": "array"
          }
        },
        "required": [
          "segments"
        ],
        "type": "object"
      },
      "DynamicPathSegment": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "enum": [
                  "literal"
                ],
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "value"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "enum": [
                  "parameter"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "name"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "enum": [
                  "catchAll"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "name"
            ],
            "type": "object"
          }
        ]
      },
      "DynamicRedirectRule": {
        "additionalProperties": false,
        "properties": {
          "from": {
            "$ref": "#/definitions/DynamicPathPattern"
          },
          "status": {
            "default": 301,
            "format": "uint16",
            "minimum": 0.0,
            "type": "integer"
          },
          "to": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "type": "object"
      },
      "FormRateClass": {
        "enum": [
          "default",
          "forms"
        ],
        "type": "string"
      },
      "FormRoute": {
        "additionalProperties": false,
        "properties": {
          "apiId": {
            "type": "string"
          },
          "contentTypes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "csrf": {
            "allOf": [
              {
                "$ref": "#/definitions/CsrfPolicy"
              }
            ],
            "default": {
              "mode": "SAME_ORIGIN"
            }
          },
          "integrationId": {
            "type": "string"
          },
          "logicalId": {
            "type": "string"
          },
          "maxBodyBytes": {
            "default": 1048576,
            "format": "uint64",
            "minimum": 0.0,
            "type": "integer"
          },
          "path": {
            "type": "string"
          },
          "rateLimitClass": {
            "allOf": [
              {
                "$ref": "#/definitions/FormRateClass"
              }
            ],
            "default": "default"
          }
        },
        "required": [
          "apiId",
          "integrationId",
          "logicalId",
          "path"
        ],
        "type": "object"
      },
      "HeaderRule": {
        "additionalProperties": false,
        "properties": {
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "headers",
          "path"
        ],
        "type": "object"
      },
      "HttpMethod": {
        "enum": [
          "GET",
          "POST",
          "PUT",
          "PATCH",
          "DELETE",
          "HEAD",
          "OPTIONS"
        ],
        "type": "string"
      },
      "ImageSource": {
        "additionalProperties": false,
        "description": "Allowlisted image origin for signed/private `/_image` sources.",
        "properties": {
          "allowedPathPrefix": {
            "description": "Normalized absolute path prefix allowed for this source.",
            "type": "string"
          },
          "contentVersion": {
            "type": "string"
          },
          "origin": {
            "description": "HTTPS origin (scheme + host, without a path).",
            "type": "string"
          },
          "secretId": {
            "type": [
              "string",
              "null"
            ]
          },
          "secretVersionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceId": {
            "type": "string"
          }
        },
        "required": [
          "allowedPathPrefix",
          "contentVersion",
          "origin",
          "sourceId"
        ],
        "type": "object"
      },
      "ManifestAsset": {
        "properties": {
          "byteLength": {
            "format": "uint64",
            "minimum": 0.0,
            "type": "integer"
          },
          "cacheClass": {
            "type": [
              "string",
              "null"
            ]
          },
          "contentDigest": {
            "type": "string"
          },
          "contentType": {
            "type": [
              "string",
              "null"
            ]
          },
          "key": {
            "type": "string"
          }
        },
        "required": [
          "byteLength",
          "contentDigest",
          "key"
        ],
        "type": "object"
      },
      "OriginBinding": {
        "additionalProperties": false,
        "properties": {
          "apiId": {
            "type": "string"
          },
          "integrationId": {
            "type": "string"
          },
          "logicalId": {
            "type": "string"
          },
          "methods": {
            "items": {
              "$ref": "#/definitions/HttpMethod"
            },
            "type": "array"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "apiId",
          "integrationId",
          "logicalId",
          "methods",
          "path"
        ],
        "type": "object"
      },
      "RedirectRule": {
        "additionalProperties": false,
        "properties": {
          "from": {
            "type": "string"
          },
          "status": {
            "default": 301,
            "format": "uint16",
            "minimum": 0.0,
            "type": "integer"
          },
          "to": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "type": "object"
      },
      "RuntimeSecretRef": {
        "additionalProperties": false,
        "description": "Customer secret reference resolved at deployment publish (write-only binding).",
        "properties": {
          "secretId": {
            "type": "string"
          },
          "versionId": {
            "type": "string"
          }
        },
        "required": [
          "secretId",
          "versionId"
        ],
        "type": "object"
      },
      "SitesRuntimeProfile": {
        "enum": [
          "skippr-preview-2026-08"
        ],
        "type": "string"
      },
      "WorkerBundle": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "$ref": "#/definitions/WorkerBundleDescribed"
          }
        ]
      },
      "WorkerBundleDescribed": {
        "properties": {
          "byteLength": {
            "format": "uint64",
            "minimum": 0.0,
            "type": [
              "integer",
              "null"
            ]
          },
          "contentDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "entry": {
            "type": "string"
          }
        },
        "required": [
          "entry"
        ],
        "type": "object"
      }
    },
    "properties": {
      "adapterId": {
        "default": null,
        "type": [
          "string",
          "null"
        ]
      },
      "clientToken": {
        "$ref": "#/definitions/ClientToken"
      },
      "contentDigest": {
        "type": "string"
      },
      "frameworkId": {
        "default": null,
        "type": [
          "string",
          "null"
        ]
      },
      "manifest": {
        "$ref": "#/definitions/DeploymentManifest"
      },
      "siteId": {
        "type": "string"
      }
    },
    "required": [
      "clientToken",
      "contentDigest",
      "manifest",
      "siteId"
    ],
    "title": "CreateDeploymentRequest",
    "type": "object"
  },
  "responseSchema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {
      "AsyncEffectState": {
        "enum": [
          "PENDING",
          "LEASED",
          "APPLIED",
          "TERMINAL_FAILED",
          "BLOCKED_PLATFORM"
        ],
        "type": "string"
      },
      "AsyncOperationStatus": {
        "properties": {
          "commandGeneration": {
            "format": "uint64",
            "minimum": 0.0,
            "type": "integer"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "edgePropagation": {
            "$ref": "#/definitions/EdgePropagationStatus"
          },
          "effectId": {
            "type": "string"
          },
          "state": {
            "$ref": "#/definitions/AsyncEffectState"
          }
        },
        "required": [
          "commandGeneration",
          "edgePropagation",
          "effectId",
          "state"
        ],
        "type": "object"
      },
      "DeploymentPutUrl": {
        "properties": {
          "contentDigest": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "key": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "contentDigest",
          "headers",
          "key",
          "url"
        ],
        "type": "object"
      },
      "DeploymentStatus": {
        "enum": [
          "UPLOADING",
          "PUBLISHING",
          "READY",
          "FAILED",
          "DELETING",
          "DELETED"
        ],
        "type": "string"
      },
      "DeploymentUploadSession": {
        "properties": {
          "expiresAt": {
            "type": "string"
          },
          "putUrls": {
            "items": {
              "$ref": "#/definitions/DeploymentPutUrl"
            },
            "type": "array"
          },
          "uploadId": {
            "type": "string"
          }
        },
        "required": [
          "expiresAt",
          "uploadId"
        ],
        "type": "object"
      },
      "EdgePropagationStatus": {
        "enum": [
          "COMPLETE",
          "PENDING",
          "FAILED"
        ],
        "type": "string"
      }
    },
    "properties": {
      "adapterId": {
        "type": [
          "string",
          "null"
        ]
      },
      "contentDigest": {
        "type": "string"
      },
      "deploymentId": {
        "type": "string"
      },
      "detail": {
        "type": [
          "string",
          "null"
        ]
      },
      "frameworkId": {
        "type": [
          "string",
          "null"
        ]
      },
      "operation": {
        "anyOf": [
          {
            "$ref": "#/definitions/AsyncOperationStatus"
          },
          {
            "type": "null"
          }
        ]
      },
      "previewHostname": {
        "type": [
          "string",
          "null"
        ]
      },
      "revision": {
        "description": "OCC revision for DeleteDeployment / conditional writes.",
        "format": "uint64",
        "minimum": 0.0,
        "type": "integer"
      },
      "siteId": {
        "type": "string"
      },
      "status": {
        "$ref": "#/definitions/DeploymentStatus"
      },
      "upload": {
        "anyOf": [
          {
            "$ref": "#/definitions/DeploymentUploadSession"
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "required": [
      "contentDigest",
      "deploymentId",
      "revision",
      "siteId",
      "status"
    ],
    "title": "DeploymentDescription",
    "type": "object"
  }
}
