{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudinary/json-schema/cloudinary-generate-archive-request-schema.json",
  "title": "generate_archive_request",
  "description": "The archive generation parameters.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudinary-platform-openapi.yml#/components/schemas/generate_archive_request",
  "allOf": [
    {
      "$ref": "#/$defs/signature_parameters"
    },
    {
      "type": "object",
      "properties": {
        "public_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 1000,
          "description": "The list of public IDs to include in the archive."
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 20,
          "description": "Tags to filter which assets to include in the archive. Assets matching any of the specified tags are included."
        },
        "prefixes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 20,
          "description": "Select all assets where the public ID starts with this prefix."
        },
        "type": {
          "$ref": "#/$defs/delivery_type_all"
        },
        "transformations": {
          "type": "string",
          "description": "The transformations to apply to the assets before including them in the archive (separated by \"|\")."
        },
        "mode": {
          "type": "string",
          "enum": [
            "download",
            "create",
            "create_and_download"
          ],
          "default": "create",
          "description": "The method for generating and delivering the archive. Options:\ndownload - Generates and delivers the archive file without storing it\ncreate - Creates and stores the archive as a raw asset, returning URLs in the response\ncreate_and_download - Creates, stores, and delivers the archive file\n"
        },
        "target_format": {
          "type": "string",
          "enum": [
            "zip",
            "tgz"
          ],
          "default": "zip",
          "description": "The format of the generated archive."
        },
        "target_public_id": {
          "type": "string",
          "description": "The public ID to assign to the generated archive, or the filename of the downloaded archive file."
        },
        "target_asset_folder": {
          "type": "string",
          "description": "The folder in your product environment where the generated archive should be stored."
        },
        "flatten_folders": {
          "type": "boolean",
          "description": "Whether to flatten all files to be in the root of the archive file.",
          "default": false
        },
        "flatten_transformations": {
          "type": "boolean",
          "description": "Whether to flatten the folder structure of the derived assets.",
          "default": false
        },
        "skip_transformation_name": {
          "type": "boolean",
          "description": "Whether to skip adding the transformation details to the file names in the archive.",
          "default": false
        },
        "allow_missing": {
          "type": "boolean",
          "description": "Whether to allow missing assets in the archive. If false, the operation will fail if any asset is not found.",
          "default": false
        },
        "expires_at": {
          "type": "integer",
          "format": "int64",
          "description": "(\"download\" mode only) Unix timestamp indicating when the generated archive URL should expire."
        },
        "use_original_filename": {
          "type": "boolean",
          "description": "Whether to use the original filenames of the assets in the archive instead of public IDs (when available).",
          "default": false
        },
        "async": {
          "type": "boolean",
          "description": "(\"create\" mode only), specifies whether to generate the archive asynchronously.",
          "default": false
        },
        "notification_url": {
          "type": "string",
          "format": "uri",
          "description": "(\"create\" mode only), specifies the URL to notify when the archive generation is complete."
        },
        "target_tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of tag names to assign to the generated archive."
        },
        "keep_derived": {
          "type": "boolean",
          "description": "Whether to keep the derived assets used for generating the archive.",
          "default": false
        },
        "fully_qualified_public_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of fully qualified public IDs (resource_type/type/public_id) to include in the archive."
        },
        "search_expression": {
          "type": "string",
          "description": "A search expression to select assets to include in the archive."
        },
        "target_filename": {
          "type": "string",
          "description": "The filename for the downloaded archive file. Extension must match target_format (zip or tgz)."
        },
        "asset_folders": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 20
            },
            {
              "type": "string"
            }
          ],
          "description": "A list of asset folder paths to include in the archive, or a single folder path string. Only available when asset folders are enabled for your account."
        }
      }
    }
  ],
  "$defs": {
    "asset_delivery_type": {
      "type": "string",
      "enum": [
        "asset"
      ],
      "description": "Static asset delivery type."
    },
    "delivery_type_all": {
      "anyOf": [
        {
          "$ref": "#/$defs/managed_delivery_type"
        },
        {
          "$ref": "#/$defs/asset_delivery_type"
        },
        {
          "$ref": "#/$defs/fetch_delivery_type"
        },
        {
          "$ref": "#/$defs/social_delivery_type"
        },
        {
          "$ref": "#/$defs/generated_delivery_type"
        },
        {
          "type": "string",
          "enum": [
            "media_optimization"
          ]
        }
      ],
      "description": "All supported delivery types."
    },
    "fetch_delivery_type": {
      "type": "string",
      "enum": [
        "fetch",
        "url2png"
      ],
      "description": "Fetch-based delivery types for assets retrieved from remote URLs."
    },
    "generated_delivery_type": {
      "type": "string",
      "enum": [
        "multi",
        "sprite",
        "text",
        "list"
      ],
      "description": "Delivery types for assets generated by Cloudinary operations."
    },
    "managed_delivery_type": {
      "type": "string",
      "enum": [
        "upload",
        "private",
        "authenticated"
      ],
      "description": "Managed delivery types for assets uploaded and stored by Cloudinary."
    },
    "signature_parameters": {
      "type": "object",
      "properties": {
        "api_key": {
          "type": "string",
          "description": "The API key to use for the request. This is automatically computed by the Cloudinary's SDKs."
        },
        "timestamp": {
          "type": "integer",
          "format": "int64",
          "description": "The timestamp to use for the request in unix time. This is automatically computed by the Cloudinary's SDKs."
        },
        "signature": {
          "type": "string",
          "description": "(Required for signed REST API calls) Used to authenticate the request and based on the parameters you use in the request. When using the Cloudinary SDKs for signed requests, the signature is automatically generated and added to the request. If you manually generate your own signed POST request, you need to manually generate the signature parameter and add it to the request together with the api_key and timestamp parameters.\n"
        }
      }
    },
    "social_delivery_type": {
      "type": "string",
      "enum": [
        "facebook",
        "twitter",
        "twitter_name",
        "instagram",
        "instagram_name",
        "gravatar",
        "youtube",
        "hulu",
        "vimeo",
        "animoto",
        "dailymotion",
        "worldstarhiphop"
      ],
      "description": "Delivery types for assets fetched from third-party platforms."
    }
  }
}