{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cosmicjs-com/json-schema/cosmicjs-com-batch-response-schema.json",
  "title": "BatchResponse",
  "description": "Results in request order. Operations succeed or fail independently, so check each `status`.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cosmicjs-com-openapi.yml#/components/schemas/BatchResponse",
  "type": "object",
  "required": [
    "operations"
  ],
  "properties": {
    "operations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "add",
              "edit",
              "delete"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "error"
            ]
          },
          "object": {
            "$ref": "#/$defs/Object"
          },
          "message": {
            "type": "string",
            "description": "Present on deletes and on failures."
          }
        },
        "additionalProperties": true
      }
    }
  },
  "$defs": {
    "Metadata": {
      "type": "object",
      "description": "Values of the Metafields defined on the Object type, keyed by Metafield `key`.\n\nThe value shape follows the Metafield type, and differs between write and read for two of them:\n\n- Text, textarea, markdown, and HTML Metafields are strings. Number Metafields are numbers, switches are booleans, dates are ISO 8601 strings.\n- Object Relationship Metafields are written as an Object `id` string (or an array of ids for the multiple variant) and returned as a nested Object (or array of Objects) once `depth` is at least 1.\n- File and Image Metafields are written as a media `name` string (or an array of names) and returned as an object with `url` and `imgix_url`, plus `alt_text`, `width`, and `height` when requested via `props`.\n- Repeater Metafields are arrays of objects keyed by the child Metafield keys.",
      "additionalProperties": true
    },
    "Object": {
      "type": "object",
      "description": "A single piece of content. Which properties are present depends on `props`.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier."
        },
        "type": {
          "type": "string",
          "description": "Object type slug."
        },
        "title": {
          "type": "string"
        },
        "slug": {
          "type": "string",
          "description": "Unique within the Object type. Localized versions of an Object share a slug and count as one Object against plan limits."
        },
        "status": {
          "type": "string",
          "enum": [
            "published",
            "draft"
          ]
        },
        "content": {
          "type": [
            "string",
            "null"
          ],
          "description": "HTML content. Deprecated in v3; use a Metafield instead.",
          "deprecated": true
        },
        "metadata": {
          "$ref": "#/$defs/Metadata"
        },
        "bucket": {
          "type": "string",
          "description": "Bucket id."
        },
        "thumbnail": {
          "type": [
            "string",
            "null"
          ],
          "description": "Media `name` of the Object thumbnail. Returned as a URL on read."
        },
        "locale": {
          "type": [
            "string",
            "null"
          ],
          "description": "Locale code, when the Object type has localization enabled."
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "created_by": {
          "type": "string",
          "description": "User id."
        },
        "modified_at": {
          "type": "string",
          "format": "date-time"
        },
        "modified_by": {
          "type": "string",
          "description": "User id."
        },
        "published_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "publish_at": {
          "type": [
            "string",
            "number",
            "null"
          ],
          "description": "UNIX millisecond timestamp for scheduled publishing."
        },
        "unpublish_at": {
          "type": [
            "string",
            "number",
            "null"
          ],
          "description": "UNIX millisecond timestamp for scheduled unpublishing."
        },
        "assigned_to": {
          "type": [
            "string",
            "null"
          ],
          "description": "User id."
        },
        "assigned_by": {
          "type": [
            "string",
            "null"
          ],
          "description": "User id."
        },
        "assigned_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "additionalProperties": true
    }
  }
}