{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/stackit/main/json-schema/stackit-put-custom-domain-payload-schema.json",
  "title": "PutCustomDomainPayload",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stackit-cdn-openapi.yml#/components/schemas/PutCustomDomainPayload",
  "properties": {
    "certificate": {
      "description": "Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted",
      "oneOf": [
        {
          "$ref": "#/$defs/PutCustomDomainManagedCertificate"
        },
        {
          "$ref": "#/$defs/PutCustomDomainCustomCertificate"
        }
      ],
      "type": "object"
    },
    "intentId": {
      "description": "While optional, it is greatly encouraged to provide an `intentId`.\nThis is used to deduplicate requests.\nIf multiple modifying Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped.\n",
      "type": "string"
    }
  },
  "type": "object",
  "$defs": {
    "PutCustomDomainCustomCertificate": {
      "description": "Returned if a custom certificate is used. Response does not contain the certificate or key.",
      "properties": {
        "certificate": {
          "description": "base64-encoded PEM-encoded certificate",
          "type": "string",
          "x-go-type": "secret.Secret"
        },
        "key": {
          "description": "base64-encoded PEM encoded key",
          "type": "string",
          "x-go-type": "secret.Secret"
        },
        "skipDnsCheck": {
          "description": "When adding a new custom domain, we do a check to verify that your Domain\npoints to the managed domain via a CNAME or ALIAS.\nIf this is not the case, the call would usually reject.\n\nThis additional property is an escape hatch to this functionality. It's useful\nfor when you are migrating onto STACKIT CDN. It allows you to migrate without\ndowntime.\n\nBy providing a custom certificate with `skipDnsCheck` set to `true`, we will\nnot check the Record for correctness. Then, once the CDN is set up, you can\nchange the CNAME Record on your DNS and update the Custom Domain entry to\ndisable this check, or switch to a managed certificate.\n\nThis field is optional. If not set, the check is **not** skipped.\n",
          "type": "boolean"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "certificate",
        "key"
      ],
      "type": "object"
    },
    "PutCustomDomainManagedCertificate": {
      "description": "This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you",
      "properties": {
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    }
  }
}