{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tale-dev/json-schema/tale-dev-bulk-create-result-schema.json",
  "title": "BulkCreateResult",
  "description": "A body the schema refuses fails the whole call with 400; a row the directory refuses (a duplicate email or external id) fails that row alone and is listed under `errors` with its code. `created` here is the list of rows that landed — unlike the boolean `created` a folder or task result carries.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tale-dev-contacts-api-openapi.yml#/components/schemas/BulkCreateResult",
  "type": "object",
  "required": [
    "success",
    "failed",
    "created",
    "errors"
  ],
  "properties": {
    "success": {
      "type": "integer"
    },
    "failed": {
      "type": "integer"
    },
    "created": {
      "type": "array",
      "description": "The rows that landed, by input index",
      "items": {
        "type": "object",
        "required": [
          "index",
          "id"
        ],
        "properties": {
          "index": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          }
        }
      }
    },
    "errors": {
      "type": "array",
      "description": "Every row that did not land, by input index — a row the schema refused (`INVALID_BODY`, with its `issues`) beside a row the directory refused (a duplicate); the rest landed regardless.",
      "items": {
        "type": "object",
        "required": [
          "index",
          "error",
          "errorCode",
          "contact"
        ],
        "properties": {
          "index": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "errorCode": {
            "type": "string",
            "enum": [
              "INVALID_BODY",
              "CONTACT_DUPLICATE_EMAIL",
              "CONTACT_DUPLICATE_EXTERNAL_ID",
              "CONTACT_CREATE_FAILED",
              "unknown"
            ],
            "description": "`INVALID_BODY` — the row failed the schema (`issues` names each field); the `CONTACT_*` codes are the single create’s own refusals."
          },
          "issues": {
            "type": "array",
            "description": "Present on an `INVALID_BODY` row: the field-named problems, paths relative to the row (`email`, not `contacts.3.email`).",
            "items": {
              "type": "object",
              "required": [
                "path",
                "message"
              ],
              "properties": {
                "path": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "contact": {
            "type": "object",
            "additionalProperties": true,
            "description": "The row as sent — a refused row is echoed whatever shape it had."
          }
        }
      }
    }
  }
}