{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-create-variation-request-schema.json",
  "title": "CreateVariationRequest",
  "description": "Request payload for the POST \"/create-variation\" API.\nCreates a variation from a template or document with specified tag mappings\nand produces one or more output types in a single request.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-express-openapi.yml#/components/schemas/CreateVariationRequest",
  "type": "object",
  "properties": {
    "templateOrDocument": {
      "$ref": "#/$defs/CreativeCloudFileIdResource",
      "description": "The source template or document on which the variation will be applied.\nSpecified as a creative cloud file id."
    },
    "input": {
      "$ref": "#/$defs/CreateVariationInput",
      "description": "The variation input details including tag mappings and optional page overrides."
    },
    "outputs": {
      "description": "The desired output types for the variation.\nNote: Only one image type output is supported currently.\n(e.g., an image rendition ).",
      "type": "array",
      "items": {
        "description": "Union of all output types that can be requested from a create-variation operation.",
        "anyOf": [
          {
            "$ref": "#/$defs/ImageOutput"
          },
          {
            "$ref": "#/$defs/DocumentOutput"
          },
          {
            "$ref": "#/$defs/PdfOutput"
          },
          {
            "$ref": "#/$defs/VideoOutput"
          }
        ]
      }
    }
  },
  "required": [
    "input",
    "outputs",
    "templateOrDocument"
  ],
  "$defs": {
    "CreateVariationInput": {
      "description": "Input details for a single variation request.",
      "type": "object",
      "properties": {
        "mappings": {
          "$ref": "#/$defs/TagMappings",
          "description": "Tag mappings to apply to the template or document."
        },
        "pageOverrides": {
          "description": "Page-specific mapping overrides for multi-page documents.\nEach entry targets a specific page number with its own set of mappings.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PageOverride"
          }
        },
        "variationRequestId": {
          "description": "The client-provided identifier for the variation request.\nIf supplied, the service echoes it back in the corresponding response\nto simplify client-side correlation.",
          "type": "string"
        }
      },
      "required": [
        "mappings"
      ]
    },
    "CreativeCloudFileIdResource": {
      "description": "A Resource object referencing an ACP asset by its file identifier.",
      "type": "object",
      "properties": {
        "creativeCloudFileId": {
          "description": "The identifier of an asset stored in ACP.\nExample: \"urn:aaid:sc:US:a21c8629-413f-55d9-9e65-83330a277ac1\"",
          "type": "string"
        }
      },
      "required": [
        "creativeCloudFileId"
      ]
    },
    "DestinationFolderResource": {
      "description": "A Resource object specifying an ACP folder as a destination for output assets.\nWhen used, the service chooses unique file names within the specified folder.",
      "type": "object",
      "properties": {
        "creativeCloudProjectId": {
          "description": "The identifier of a project to store output assets in.",
          "type": "string"
        },
        "creativeCloudFolderId": {
          "description": "The identifier of a folder to store output assets in.",
          "type": "string"
        }
      }
    },
    "DocumentOutput": {
      "description": "Requested Express document output configuration.",
      "type": "object",
      "properties": {
        "type": {
          "description": "Discriminator indicating document output type.",
          "type": "string",
          "enum": [
            "document"
          ]
        },
        "preferredDocumentName": {
          "description": "The preferred name for the generated document.\nIf not provided or already in use, a unique name is auto-generated.",
          "type": "string"
        },
        "destinationFolder": {
          "description": "The ACP folder where the generated document should be saved.\nIf not provided, the document is saved to the user's default storage.",
          "$ref": "#/$defs/DestinationFolderResource"
        }
      },
      "required": [
        "type"
      ]
    },
    "ImageMapping": {
      "description": "A mapping that replaces an image-type tagged element.",
      "type": "object",
      "properties": {
        "tagName": {
          "description": "The name of the tag to replace. Must match a tag name\nreturned by the tagged-documents API.",
          "type": "string"
        },
        "source": {
          "$ref": "#/$defs/UrlResource",
          "description": "The source of the replacement media, specified as a pre-signed URL."
        }
      },
      "required": [
        "source",
        "tagName"
      ]
    },
    "ImageOutput": {
      "description": "Requested image rendition output configuration.",
      "type": "object",
      "properties": {
        "type": {
          "description": "Discriminator indicating image output type.",
          "type": "string",
          "enum": [
            "image"
          ]
        },
        "mediaType": {
          "$ref": "#/$defs/ImageRenditionFormat",
          "description": "The media type of the image rendition."
        },
        "size": {
          "description": "The size of the image rendition on the longest side in pixels.\nThe aspect ratio is maintained. Min: 1, Max: 8192.\nIf not provided, the default size of page is considered.",
          "type": "number"
        },
        "pages": {
          "description": "A comma-separated string of page numbers to render as image renditions. For example, \"1,2,3\".\nPage ranges can also be specified. For example, \"1-3\" includes pages 1, 2, and 3.\nAnother example is \"1,3-5\", which includes pages 1, 3, 4, and 5.\n\"1-\" can be used to specify all pages, while \"5-\" indicates page 5 to the last page.\nIf not provided, all pages are considered. Page numbers start from 1.",
          "type": "string"
        }
      },
      "required": [
        "mediaType",
        "type"
      ]
    },
    "ImageRenditionFormat": {
      "description": "The format of the bitmap rendition.",
      "enum": [
        "image/jpeg",
        "image/png"
      ],
      "type": "string"
    },
    "PageOverride": {
      "description": "Page-specific mapping overrides for multi-page documents.",
      "type": "object",
      "properties": {
        "pageNumber": {
          "description": "The page number to apply overrides to. Page numbers start from 1.",
          "type": "number"
        },
        "mappings": {
          "$ref": "#/$defs/TagMappings",
          "description": "Tag mappings specific to this page, overriding any top-level mappings."
        }
      },
      "required": [
        "mappings",
        "pageNumber"
      ]
    },
    "PdfMarginUnit": {
      "description": "The unit of measurement for the bleed or crop margin.",
      "enum": [
        "in",
        "mm"
      ],
      "type": "string"
    },
    "PdfOutput": {
      "description": "Requested PDF rendition output configuration.",
      "type": "object",
      "properties": {
        "type": {
          "description": "Discriminator indicating PDF output type.",
          "type": "string",
          "enum": [
            "pdf"
          ]
        },
        "pdfType": {
          "description": "The PDF rendering profile. Defaults to \"standard\".",
          "enum": [
            "print",
            "standard"
          ],
          "type": "string"
        },
        "downloadIndividualPdfFiles": {
          "description": "When true, each page is exported as a separate PDF file.\nWhen false or omitted, all pages are combined into a single PDF.",
          "type": "boolean"
        },
        "config": {
          "description": "Optional bleed/accessibility configuration for the PDF rendition.",
          "anyOf": [
            {
              "$ref": "#/$defs/PrintConfig"
            },
            {
              "$ref": "#/$defs/StandardConfig"
            }
          ]
        },
        "pages": {
          "description": "A comma-separated string of page numbers to include in the PDF rendition. For example, \"1,2,3\".\nPage ranges can also be specified. For example, \"1-3\" includes pages 1, 2, and 3.\nAnother example is \"1,3-5\", which includes pages 1, 3, 4, and 5.\n\"1-\" can be used to specify all pages, while \"5-\" indicates page 5 to the last page.\nIf not provided, all pages are considered. Page numbers start from 1.",
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "PrintConfig": {
      "description": "Configuration options for print-ready PDF renditions.",
      "type": "object",
      "properties": {
        "bleed": {
          "description": "Controls whether to include bleed settings in the PDF.\nDefaults to false.",
          "type": "boolean"
        },
        "bleedSettings": {
          "description": "Configuration settings for bleed margins.\nOnly applies when bleed is true.\nDefault value is 0.125 <unit>.",
          "$ref": "#/$defs/ValueWithUnit"
        },
        "cropMargins": {
          "description": "Controls whether to include crop margins in the PDF.\nDefaults to false.",
          "type": "boolean"
        },
        "cropMarginsSettings": {
          "description": "Configuration settings for crop margins.\nOnly applies when cropMargins is true.\nDefault value is 0.125 <unit>.",
          "$ref": "#/$defs/ValueWithUnit"
        }
      }
    },
    "StandardConfig": {
      "description": "Configuration settings for standard PDF rendition.",
      "type": "object",
      "properties": {
        "accessibilityTags": {
          "description": "Controls whether accessibility tags are included in the PDF.\nWhen true, accessibility tags will be embedded in the PDF.\nWhen false, accessibility tags will be omitted.\n\nDefaults to false.",
          "type": "boolean"
        }
      }
    },
    "TagMappings": {
      "description": "Collection of tag-to-value mappings for a variation, organized by element type.",
      "type": "object",
      "properties": {
        "textMappings": {
          "description": "Mappings for text-type tagged elements.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/TextMapping"
          }
        },
        "imageMappings": {
          "description": "Mappings for image-type tagged elements.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ImageMapping"
          }
        },
        "videoMappings": {
          "description": "Mappings for video-type tagged elements.\nEach entry replaces a video placeholder in the template with the\nvideo at the given pre-signed URL.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/VideoMapping"
          }
        }
      }
    },
    "TextMapping": {
      "description": "A mapping that replaces a text-type tagged element.",
      "type": "object",
      "properties": {
        "tagName": {
          "description": "The name of the text tag to replace. Must match a tag name\nreturned by the tagged-documents API.",
          "type": "string"
        },
        "text": {
          "description": "The replacement text value.",
          "type": "string"
        }
      },
      "required": [
        "tagName",
        "text"
      ]
    },
    "UrlResource": {
      "description": "A Resource object referencing an asset via a pre-signed URL.\nUsed for customer-supplied storage or Adobe-owned temporary storage.",
      "type": "object",
      "properties": {
        "url": {
          "description": "An absolute pre-signed URL used to GET an input asset or PUT an output asset.\nAllowed domains include AWS S3, Azure Blob Storage, and Dropbox.",
          "type": "string"
        },
        "storageType": {
          "description": "Required only for output parameters when the URL targets\nAzure BlobStore or Dropbox storage.",
          "enum": [
            "Azure",
            "Dropbox"
          ],
          "type": "string"
        }
      },
      "required": [
        "url"
      ]
    },
    "ValueWithUnit": {
      "description": "Configuration settings for the \"print\" PDF rendition.\nIt includes values to adjust the amount and unit of measurement.",
      "type": "object",
      "properties": {
        "amount": {
          "description": "The amount of bleed or crop margin.\nIt can be a positive or negative value.",
          "type": "number"
        },
        "unit": {
          "$ref": "#/$defs/PdfMarginUnit",
          "description": "The unit of measurement for the bleed or crop margin."
        }
      },
      "required": [
        "amount",
        "unit"
      ]
    },
    "VideoMapping": {
      "description": "A mapping that replaces a video-type tagged element.\nThe URL must resolve to a supported video MIME type (mp4, quicktime, etc.).",
      "type": "object",
      "properties": {
        "tagName": {
          "description": "The name of the tag to replace. Must match a tag name\nreturned by the tagged-documents API.",
          "type": "string"
        },
        "source": {
          "$ref": "#/$defs/UrlResource",
          "description": "The source of the replacement media, specified as a pre-signed URL."
        }
      },
      "required": [
        "source",
        "tagName"
      ]
    },
    "VideoOutput": {
      "description": "Requested video rendition output configuration.",
      "type": "object",
      "properties": {
        "type": {
          "description": "Discriminator indicating video output type.",
          "type": "string",
          "enum": [
            "video"
          ]
        },
        "mediaType": {
          "description": "The media type of the video rendition.",
          "type": "string",
          "enum": [
            "video/mp4"
          ]
        },
        "size": {
          "description": "The size of the video rendition on the longest side in pixels.\nThe aspect ratio is maintained. Min: 146, Max: 4096.\nIf not provided, the default size of the page is considered.",
          "type": "number"
        },
        "pages": {
          "description": "The pages to export video renditions for, as a comma-separated string of page numbers.\nFor example, \"1,2,3\". Page ranges can also be specified: \"1-3\" includes pages 1, 2, and 3;\n\"1,3-5\" includes pages 1, 3, 4, and 5; \"1-\" is page 1 to the last page; \"5-\" is page 5 to the\nlast page. Page numbers start from 1. If not provided, all pages that support video export are\nexported. Pages that do not support video export are reported as per-page errors.",
          "type": "string"
        }
      },
      "required": [
        "mediaType",
        "type"
      ]
    }
  }
}