{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-merge-data-request-v4-schema.json",
  "title": "MergeDataRequestV4",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-indesign-openapi.yml#/components/schemas/MergeDataRequestV4",
  "allOf": [
    {
      "$ref": "#/$defs/BaseJobRequestWithOutput"
    },
    {
      "description": "Inputs for the data merge request.",
      "type": "object",
      "required": [
        "params"
      ],
      "properties": {
        "params": {
          "type": "object",
          "required": [
            "targetDocument",
            "dataSource"
          ],
          "properties": {
            "targetDocument": {
              "description": "The tagged document to be used as the template for merging.",
              "type": "string"
            },
            "dataSource": {
              "description": "The data source files to be used.",
              "type": "string"
            },
            "outputMediaType": {
              "description": "The type of output.",
              "type": "string",
              "enum": [
                "image/jpeg",
                "image/png",
                "application/pdf",
                "application/x-indesign"
              ],
              "default": "application/x-indesign"
            },
            "rulesFile": {
              "description": "The rule json file having all the conditions and actions.",
              "type": "string"
            },
            "copyfittingSettings": {
              "type": "object",
              "required": [
                "enabled"
              ],
              "description": "Enables automatic copyfitting (font-size reduction) to resolve overset text after a merge. Copyfitting runs only when `enabled` is true; if the object is omitted, copyfitting is off.",
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "description": "Master switch. Copyfitting runs only when true. If false, absent, or the object is omitted, copyfitting is off. Required to turn the feature on.",
                  "default": false
                },
                "unresolvedOversetHandling": {
                  "type": "string",
                  "description": "Behavior when text is still overset after copyfitting. One of: `warn`, `omit_records`.",
                  "default": "warn",
                  "enum": [
                    "warn",
                    "omit_records"
                  ]
                },
                "multiFrameSyncScope": {
                  "type": "string",
                  "description": "Applies the same font-size reduction to matching non-overset frames. One of: `paragraph_style`, `page`, `paragraph_style_and_page`, `document`. Omit to skip multi-frame sync.",
                  "enum": [
                    "paragraph_style",
                    "page",
                    "paragraph_style_and_page",
                    "document"
                  ]
                },
                "scope": {
                  "type": "object",
                  "properties": {
                    "global": {
                      "type": "object",
                      "properties": {
                        "constraints": {
                          "type": "object",
                          "properties": {
                            "fontSize": {
                              "type": "object",
                              "properties": {
                                "minPercent": {
                                  "type": "number",
                                  "description": "Floor for font-size reduction, as a percentage of the original size. Must be between 1 and 100; 100 means the text never shrinks.",
                                  "default": 85
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "exportSettings": {
              "type": "object",
              "description": "The settings corresponding to the output format.",
              "properties": {
                "jobOptionsFile": {
                  "type": "string",
                  "description": "File path reference to a `.joboptions` file (Adobe PDF preset file) containing custom PDF export settings. This file must be included as part of the input assets. It defines detailed PDF output configurations such as compression, color management, and security settings. When provided, this takes precedence over the `pdfPreset` attribute. Only applicable when generating PDF output.",
                  "default": "PDF preset `High Quality Print` will be used if not provided."
                },
                "pdfPreset": {
                  "type": "string",
                  "description": "The PDF export style to be used. This is relevant if `outputMediaType` is `application/pdf`.",
                  "default": "High Quality Print",
                  "enum": [
                    "High Quality Print",
                    "PDF/X-1a:2001",
                    "PDF/X-3:2002",
                    "PDF/X-4:2008",
                    "Press Quality",
                    "Smallest File Size"
                  ]
                },
                "quality": {
                  "type": "string",
                  "description": "Defines the quality of the output for JPEG and PNG formats.",
                  "default": "medium",
                  "enum": [
                    "low",
                    "medium",
                    "high",
                    "maximum"
                  ]
                },
                "linkImages": {
                  "description": "If `true`, links images to the target document. If `false`, embeds linked images already referred in the target document.  Only relevant if `outputMediaType` is `application/x-indesign`.",
                  "type": "boolean",
                  "default": false
                }
              }
            },
            "recordRange": {
              "description": "The ranges of records to process for this job. Value can be `All`, along with numeral ranges. For example, '1-2, 5'.",
              "type": "string",
              "default": "All"
            },
            "allowMultipleRecordsPerPage": {
              "description": "If `true`, will show as many records as will fit on a page.",
              "type": "boolean",
              "default": false
            },
            "multipleRecordLayoutOptions": {
              "description": "The options to be used when `allowMultipleRecordsPerPage` is set to `true`.",
              "type": "object",
              "properties": {
                "arrangeBy": {
                  "description": "The order that records will be arranged in the target document.\n* `rows_first` - Arranges records by row.\n* `columns_first` - Arranges records by column.\n",
                  "type": "string",
                  "default": "rows_first",
                  "enum": [
                    "rows_first",
                    "columns_first"
                  ]
                },
                "bottomMargin": {
                  "description": "The offset value of the bottom margin in the target document. The values can be specified like `1 pt`, `1 pica`, `1`, etc. If a number is mentioned in the string, it will be used as a value in pica.",
                  "type": "string"
                },
                "topMargin": {
                  "description": "The offset value of the top margin in the target document.  The values can be specified like `1 pt`, `1 pica`, `1`, etc. If a number is mentioned in the string, it will be used as a value in pica.",
                  "type": "string"
                },
                "leftMargin": {
                  "description": "The offset value of the left margin in the target document. The values can be specified like `1 pt`, `1 pica`, `1`, etc. If a number is mentioned in the string, it will be used as a value in pica.",
                  "type": "string"
                },
                "rightMargin": {
                  "description": "The offset value of the right margin in the target document. The values can be specified like `1 pt`, `1 pica`, `1`, etc. If a number is mentioned in the string, it will be used as a value in pica.",
                  "type": "string"
                },
                "columnSpacing": {
                  "description": "The amount of spacing between columns of records in the target document.  The values can be specified like `1 pt`, `1 pica`, `1`, etc. If a number is mentioned in the string, it will be used as a value in pica.",
                  "type": "string"
                },
                "rowSpacing": {
                  "description": "The amount of spacing between rows of records in the target document.  The values can be specified like `1 pt`, `1 pica`, `1`, etc. If a number is mentioned in the string, it will be used as a value in pica.",
                  "type": "string"
                }
              }
            },
            "imagePlacementOptions": {
              "description": "These are the options for image placement which will be used while merging images in the document.",
              "type": "object",
              "properties": {
                "centerImage": {
                  "description": "If true, this centers the image in the frame while preserving the frame size as content size and proportions. If the content is larger than the frame, content around the edges is obscured by the bounding box of the frame. <br></br> This won't work when `fittingOption` is `Content_Aware_Fit`.",
                  "type": "boolean",
                  "default": false
                },
                "fittingOption": {
                  "description": "The method of fitting content in a frame.\n* `content_aware_fit` - Selects best crop region of the content for the frame based on Adobe Sensei. This preserves frame size but it might scale the content size. If this fitting is set, the `centerImage` property is turned-off.\n* `fill_proportional` - Resizes content to fill the frame while preserving the proportions of the content. If the content and frame have different proportions, some of the content is obscured by the bounding box of the frame.\n* `fit_content_to_frame` - Resizes content to fit the frame. Content that is a different size than the frame appears stretched or squeezed.\n* `fit_frame_to_content` - Resizes the frame so it fits the content.\n* `honor_existing_style` - Applies the frame fitting based on existing settings applied on the original frame.\n* `preserve_sizes` - Preserves the original sizes of the frame and the content. Content that is larger than the frame is obscured around the edges.\n* `proportional` - Resizes content to fit the frame while preserving content proportions. If the content and frame have different proportions, an empty space occurs in the frame.\n",
                  "type": "string",
                  "default": "proportional",
                  "enum": [
                    "content_aware_fit",
                    "fill_proportional",
                    "fit_content_to_frame",
                    "fit_frame_to_content",
                    "honor_existing_style",
                    "preserve_sizes",
                    "proportional"
                  ]
                },
                "linkImages": {
                  "description": "This applies to the images being brought in the document while merging. If true, this links images to the target document. If false, it embeds images in the target document.",
                  "type": "boolean",
                  "default": false
                }
              }
            },
            "hyphenationSettings": {
              "description": "Hyphenation settings to control word breaking and hyphenation behavior during merge.",
              "type": "object",
              "properties": {
                "afterFirst": {
                  "type": "integer",
                  "description": "Minimum number of characters at the start of a word before a hyphen may be inserted."
                },
                "beforeLast": {
                  "type": "integer",
                  "description": "Minimum number of characters at the end of a word after a hyphen."
                },
                "wordsLongerThan": {
                  "type": "integer",
                  "description": "Minimum word length for hyphenation to apply."
                },
                "ladderLimit": {
                  "type": "integer",
                  "description": "Maximum allowed consecutive hyphenated lines."
                },
                "zone": {
                  "type": "number",
                  "description": "Whitespace ratio allowed at the end of a line before hyphenation begins (0–1)."
                },
                "capitalizedWords": {
                  "type": "boolean",
                  "description": "If true, allows hyphenation of capitalized words."
                },
                "lastWord": {
                  "type": "boolean",
                  "description": "If true, allows hyphenation of the last word in a paragraph."
                },
                "acrossColumns": {
                  "type": "boolean",
                  "description": "If true, allows hyphenation across columns."
                },
                "dictionarySettings": {
                  "type": "array",
                  "description": "Special hyphenation definitions by language.",
                  "items": {
                    "type": "object",
                    "required": [
                      "language",
                      "wordList"
                    ],
                    "properties": {
                      "language": {
                        "$ref": "#/$defs/HyphenationLanguage"
                      },
                      "wordList": {
                        "type": "array",
                        "description": "List of special hyphenation definitions (use `~` to mark break points, e.g., `Know~how`, `check~in`. Put `~` at the beginning of the word to exclude it from hyphenation, e.g., `~Wallstreet`, `~Starbucks`).",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            },
            "recordsPerFile": {
              "description": "The maximum number of records per output file.",
              "type": "integer",
              "default": "By default this would not be applicable."
            },
            "removeBlankLines": {
              "description": "If true, removes blank lines caused by empty fields.",
              "type": "boolean",
              "default": false
            },
            "convertUrlToHyperlink": {
              "description": "If true, all URLs in the merged document are converted into hyperlinks.",
              "type": "boolean",
              "default": true
            },
            "outputFileBaseString": {
              "type": "string",
              "description": "The name of the output file.",
              "default": "It is derived from the original document filename."
            },
            "outputFolderPath": {
              "type": "string",
              "description": "The path of the output folder.",
              "default": "A unique temporary folder name would be created."
            },
            "presignedUrlsInDataSource": {
              "description": "If true, fetches images from pre-signed URLs in the datasource `Image` column.",
              "type": "boolean",
              "default": false
            },
            "outputCompressMediaType": {
              "type": "string",
              "description": "The compression type for the output, if compressed output is desired.",
              "enum": [
                "application/zip"
              ]
            },
            "outputCompressName": {
              "type": "string",
              "description": "The name of the resulting compressed output file.",
              "default": "Result"
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "BaseJobRequest": {
      "description": "The base job request for any job.",
      "required": [
        "assets"
      ],
      "properties": {
        "assets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InputAsset"
          },
          "description": "Information about the assets, which will be used to process the job."
        },
        "params": {
          "type": "object",
          "properties": {
            "generalSettings": {
              "description": "General settings.",
              "type": "object",
              "properties": {
                "fonts": {
                  "description": "Settings related to fonts. It is recommended to include fonts to avoid missing fonts warnings when processing the job.",
                  "type": "object",
                  "properties": {
                    "fontsDirectories": {
                      "description": "This lists the font directories for the input InDesign documents. \"Document Fonts\" in parallel to the document will continue to work even without specifying them.  <br></br> If none are specified, a temporary base directory (working directory) will be considered as a font directory.",
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "This provides a path to a directory relative to a temporary base directory (working directory) where the fonts can be found. It cannot go up using '..' or '/'. Should be a valid path. For specifying a working directory, mention '.'."
                      }
                    },
                    "missingFontStrategy": {
                      "description": "This specifies the strategy to be used when a font is missing. One of: `fallback`, `fail`. Defaults to `fallback`.",
                      "type": "string",
                      "enum": [
                        "fallback",
                        "fail"
                      ],
                      "default": "fallback"
                    }
                  }
                },
                "links": {
                  "description": "Settings related to links.",
                  "type": "object",
                  "properties": {
                    "replaceLinks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "targetDocument",
                          "mapping"
                        ],
                        "properties": {
                          "targetDocument": {
                            "description": "The document in which the relinking is to be done. Relinking of assets is required to ensure that there are no missing links in the output document.",
                            "type": "string"
                          },
                          "mapping": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "newAssetRelativePath"
                              ],
                              "properties": {
                                "newAssetRelativePath": {
                                  "type": "string",
                                  "description": "This provides a path relative to a temporary base directory (working directory) where the asset to be linked to can be found. It cannot go up using '..' or '/'. Should be a valid file name."
                                },
                                "currentURI": {
                                  "type": "string",
                                  "description": "The existing URI of the link that needs relinking. If multiple links with this URI are found, all will be relinked. If `linkID` is provided, this attribute will be ignored. Either `currentURI` or `linkID` should be present."
                                },
                                "linkID": {
                                  "type": "integer",
                                  "description": "The ID of the link which is to be relinked. If `currentURI` is also provided, it will be ignored. Either `currentURI` or `linkID` should be present."
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "appLogs": {
                  "description": "Describes parameters regarding application logs.",
                  "type": "object",
                  "properties": {
                    "logsRelativePath": {
                      "type": "string",
                      "description": "This provides a path to a file, relative to the temporary base directory (working directory). This file is where the application's logs are to be dumped."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "BaseJobRequestWithOutput": {
      "allOf": [
        {
          "$ref": "#/$defs/BaseJobRequest"
        },
        {
          "description": "The base job request for any job with the option to specify output URLs.",
          "type": "object",
          "properties": {
            "outputs": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/OutputAsset"
              }
            }
          }
        }
      ]
    },
    "HyphenationLanguage": {
      "type": "string",
      "description": "Supported hyphenation dictionary languages.",
      "enum": [
        "Arabic",
        "Bengali (India)",
        "Bulgarian",
        "Burmese (Myanmar [Burma])",
        "Catalan",
        "Croatian",
        "Czech",
        "Danish",
        "Dutch: 2005 Reform",
        "Dutch: Old Rules",
        "English: Canadian",
        "English: UK",
        "English: USA",
        "English: USA Legal",
        "English: USA Medical",
        "Estonian",
        "Finnish",
        "French",
        "French: Canadian",
        "German: 1996 Reform",
        "German: 2006 Reform",
        "German: Austria 2006 Reform",
        "German: Old Rules",
        "German: Swiss",
        "German: Swiss 2006 Reform",
        "Greek",
        "Gujarati (India)",
        "Hebrew",
        "Hindi (India)",
        "Hungarian",
        "Indonesian (Indonesia)",
        "Italian",
        "Kannada (India)",
        "Khmer (Cambodia)",
        "Lao (Laos)",
        "Latvian",
        "Lithuanian",
        "Malayalam (India)",
        "Marathi (India)",
        "Norwegian: Bokmål",
        "Norwegian: Nynorsk",
        "Oriya (India)",
        "Polish",
        "Portuguese",
        "Portuguese: Brazilian",
        "Portuguese: Orthographic Agreement",
        "Punjabi (India)",
        "Romanian",
        "Russian",
        "Sinhala (Sri Lanka)",
        "Slovak",
        "Slovenian",
        "Spanish",
        "Swedish",
        "Tamil (India)",
        "Telugu (India)",
        "Thai",
        "Turkish",
        "Ukrainian",
        "Vietnamese"
      ]
    },
    "InputAsset": {
      "type": "object",
      "description": "The URL where the asset will be fetched.",
      "required": [
        "source"
      ],
      "properties": {
        "source": {
          "type": "object",
          "required": [
            "url"
          ],
          "properties": {
            "url": {
              "type": "string",
              "description": "The pre-signed URL of the input asset. This is the URL of the asset that will be downloaded and acted upon during the job."
            }
          }
        },
        "destination": {
          "type": "string",
          "description": "This provides a path relative to a temporary base directory (working directory) where the resource would be downloaded. This would be used to identify the assets within the parameters. It cannot go up using '..' or '/'. Should be a valid file name."
        }
      }
    },
    "OutputAsset": {
      "description": "The URL where the output assets are to be posted after the job is processed.",
      "type": "object",
      "required": [
        "destination",
        "source"
      ],
      "properties": {
        "destination": {
          "type": "object",
          "required": [
            "url"
          ],
          "properties": {
            "url": {
              "type": "string",
              "description": "The URL of the asset."
            },
            "storageType": {
              "type": "string",
              "description": "This is an optional parameter, however IT IS RECOMMENDED to provide this information.",
              "enum": [
                "Azure",
                "Dropbox",
                "AWS"
              ]
            }
          }
        },
        "source": {
          "type": "string",
          "description": "This provides a path relative of the output where the resource would be generated. It cannot go up using '..' or '/'. Should be a valid file name."
        }
      }
    }
  }
}