{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.1.0-rc.4/brand/verify-brand-claims-response.json",
  "title": "Verify Brand Claims Response (Bulk)",
  "description": "Bulk response for `verify_brand_claims`. `results[]` is positionally aligned with the request's `claims[]` (zip-by-index). Per-result success carries `claim_type` + `status` + per-claim-type `details`; per-result failure carries an `error` field on that single result without failing the batch. Top-level `errors[]` is reserved for batch-level failures (auth, rate-limit, malformed request) — in that case `results` is absent. Top-level `Cache-Control` represents the lowest-common max-age across the batch; individual results MAY carry their own staleness signals out-of-band.",
  "type": "object",
  "allOf": [
    {
      "$ref": "/schemas/3.1.0-rc.4/core/version-envelope.json"
    },
    {
      "$ref": "/schemas/3.1.0-rc.4/core/protocol-envelope.json"
    }
  ],
  "oneOf": [
    {
      "title": "VerifyBrandClaimsSuccess",
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "description": "Per-claim results, positionally aligned with the request's `claims[]`. Each entry is either a per-claim success (claim_type + status + optional details/context_note) or a per-claim error (error field only).",
          "minItems": 1,
          "items": {
            "$ref": "#/definitions/result_entry"
          }
        },
        "context": {
          "$ref": "/schemas/3.1.0-rc.4/core/context.json"
        },
        "signed_response": {
          "$ref": "#/definitions/signed_response",
          "description": "Payload-envelope JWS attesting the canonical bulk success response for verify_brand_claims. The signed payload response MUST match the unsigned task-body fields on this response, excluding signed_response and protocol/version envelope fields."
        },
        "ext": {
          "$ref": "/schemas/3.1.0-rc.4/core/ext.json"
        }
      },
      "required": [
        "results",
        "signed_response"
      ],
      "additionalProperties": true,
      "not": {
        "anyOf": [
          {
            "required": [
              "errors"
            ]
          }
        ]
      }
    },
    {
      "title": "VerifyBrandClaimsError",
      "type": "object",
      "description": "Batch-level failure — the entire request was rejected. Use per-result `error` on the success arm for per-claim failures that should not fail the batch.",
      "properties": {
        "errors": {
          "type": "array",
          "items": {
            "$ref": "/schemas/3.1.0-rc.4/core/error.json"
          },
          "minItems": 1
        },
        "context": {
          "$ref": "/schemas/3.1.0-rc.4/core/context.json"
        },
        "ext": {
          "$ref": "/schemas/3.1.0-rc.4/core/ext.json"
        }
      },
      "required": [
        "errors"
      ],
      "additionalProperties": true,
      "not": {
        "anyOf": [
          {
            "required": [
              "results"
            ]
          }
        ]
      }
    }
  ],
  "properties": {},
  "definitions": {
    "signed_response": {
      "allOf": [
        {
          "$ref": "/schemas/3.1.0-rc.4/core/response-payload-jws-envelope.json"
        },
        {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "task": {
                  "type": "string",
                  "const": "verify_brand_claims"
                },
                "response": {
                  "$ref": "#/definitions/signed_success_payload"
                }
              },
              "required": [
                "task",
                "response"
              ]
            }
          }
        }
      ]
    },
    "signed_success_payload": {
      "type": "object",
      "description": "Canonical bulk task-body success payload signed inside signed_response.payload.response. Excludes protocol/version envelope fields and signed_response itself.",
      "properties": {
        "results": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/definitions/result_entry"
          }
        },
        "context": {
          "$ref": "/schemas/3.1.0-rc.4/core/context.json"
        },
        "ext": {
          "$ref": "/schemas/3.1.0-rc.4/core/ext.json"
        }
      },
      "required": [
        "results"
      ],
      "additionalProperties": true,
      "not": {
        "anyOf": [
          {
            "required": [
              "errors"
            ]
          },
          {
            "required": [
              "signed_response"
            ]
          }
        ]
      }
    },
    "result_entry": {
      "type": "object",
      "description": "One entry in `results[]`. Either a per-claim success (claim_type + status + optional details/context_note) or a per-claim error (error field only). Mirrors the single-target `verify_brand_claim` response success arm shape.",
      "oneOf": [
        {
          "title": "VerifyBrandClaimsResultSuccess",
          "type": "object",
          "properties": {
            "claim_type": {
              "type": "string",
              "enum": [
                "subsidiary",
                "parent",
                "property",
                "trademark"
              ],
              "description": "Echoes the request item's claim_type for caller-side routing."
            },
            "status": {
              "$ref": "/schemas/3.1.0-rc.4/brand/verification-status.json",
              "description": "Verification status for this claim. Not every status applies to every claim_type — see the single-target task page for the applicable subset."
            },
            "details": {
              "type": "object",
              "description": "Per-claim-type response fields. Shape varies — see the single-target task page for each claim_type's expected fields.",
              "additionalProperties": true
            },
            "context_note": {
              "type": "string",
              "maxLength": 500,
              "description": "Public — free-text context the brand chooses to surface."
            }
          },
          "required": [
            "claim_type",
            "status"
          ],
          "additionalProperties": true,
          "not": {
            "anyOf": [
              {
                "required": [
                  "error"
                ]
              }
            ]
          }
        },
        {
          "title": "VerifyBrandClaimsResultError",
          "type": "object",
          "description": "Per-claim failure carried inline so a batch can return partial results. Distinct from the batch-level errors arm.",
          "properties": {
            "error": {
              "$ref": "/schemas/3.1.0-rc.4/core/error.json"
            }
          },
          "required": [
            "error"
          ],
          "additionalProperties": true,
          "not": {
            "anyOf": [
              {
                "required": [
                  "status"
                ]
              },
              {
                "required": [
                  "claim_type"
                ]
              }
            ]
          }
        }
      ]
    }
  }
}
