{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/kontaktio/main/json-schema/kontaktio-entity-create-update-result-schema.json",
  "title": "EntityCreateUpdateResult",
  "description": "Response model that summarizes the result of a batch create/update operation.",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kontaktio-entity-integration-api-openapi.yml#/components/schemas/EntityCreateUpdateResult",
  "type": "object",
  "properties": {
    "processed": {
      "type": "integer",
      "description": "Number of entities successfully created or updated."
    },
    "totalItems": {
      "type": "integer",
      "description": "Total number of entities submitted in the request."
    },
    "errors": {
      "type": "array",
      "description": "A list of failed items along with details about each error.",
      "items": {
        "$ref": "#/$defs/ItemError"
      }
    }
  },
  "required": [
    "processed",
    "totalItems"
  ],
  "$defs": {
    "ItemError": {
      "type": "object",
      "description": "Details about an entity that couldn't be processed.",
      "properties": {
        "item": {
          "type": "string",
          "description": "The `entityId` of the failed entity."
        },
        "errorMessage": {
          "type": "string",
          "description": "Message describing the error."
        }
      },
      "required": [
        "item",
        "errorMessage"
      ]
    }
  }
}