{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mailcheer-com/json-schema/mailcheer-com-subscriber-batch-result-schema.json",
  "title": "SubscriberBatchResult",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mailcheer-com-subscribers-api-openapi.yml#/components/schemas/SubscriberBatchResult",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "const": "batch"
    },
    "data": {
      "type": "array",
      "description": "One line per entry, in order. `created` and `updated` carry the fields of `POST /api/v1/subscribers`'s response (`subscriber`, `confirmation_sent`…); `rejected` carries `error` — the refusal the single add would have returned.",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "result": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "rejected"
            ]
          },
          "subscriber": {
            "$ref": "#/$defs/Subscriber"
          },
          "confirmation_sent": {
            "type": "boolean"
          },
          "confirmation_not_sent_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "confirmation_retry_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ignored_fields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "$ref": "#/$defs/error"
          }
        }
      }
    },
    "summary": {
      "type": "object",
      "properties": {
        "created": {
          "type": "integer"
        },
        "updated": {
          "type": "integer"
        },
        "rejected": {
          "type": "integer"
        }
      }
    }
  },
  "$defs": {
    "Subscriber": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "object": {
          "type": "string",
          "const": "subscriber"
        },
        "email": {
          "type": "string"
        },
        "first_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "last_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "subscribed",
            "unsubscribed",
            "bounced",
            "complained"
          ]
        },
        "source": {
          "type": [
            "string",
            "null"
          ]
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "fields": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "confirmed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "unsubscribed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "The last change to the record: status, name, fields, tags. Keep the largest value you receive and pass it as `updated_since` next time, minus one minute."
        }
      }
    }
  }
}