{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/onclarity-com/json-schema/onclarity-com-bulk-write-records-request-schema.json",
  "title": "BulkWriteRecordsRequest",
  "description": "Insert many records in one transaction — or upsert them on a unique index.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/onclarity-com-agent-store-api-openapi.yml#/components/schemas/BulkWriteRecordsRequest",
  "properties": {
    "records": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Records",
      "description": "1..1000 records keyed by schema field name, each validated like a single insert (the full 'required' set applies). All are written or none."
    },
    "upsert_on": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Upsert On",
      "description": "The field(s) of a unique index. A record whose key already exists is updated instead of failing with 409: its fields overwrite the stored ones, the fields it leaves out keep their values."
    }
  },
  "type": "object",
  "required": [
    "records"
  ]
}