{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/listdrop-co/json-schema/listdrop-co-create-list-request-schema.json",
  "title": "CreateListRequest",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/listdrop-co-openapi.json#/components/schemas/CreateListRequest",
  "type": "object",
  "required": [
    "title",
    "items"
  ],
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "emoji": {
      "type": "string",
      "maxLength": 8,
      "description": "Optional single emoji for the list."
    },
    "description": {
      "type": "string",
      "maxLength": 280
    },
    "tags": {
      "type": "array",
      "maxItems": 8,
      "items": {
        "type": "string"
      },
      "description": "Topic tags, plain words (books, travel)."
    },
    "items": {
      "type": "array",
      "minItems": 1,
      "maxItems": 50,
      "items": {
        "$ref": "#/$defs/ListItemInput"
      }
    },
    "allowed_emails": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "type": "string",
        "format": "email"
      },
      "description": "Optional email gate: these addresses can VIEW the private list at its URL after verifying the address via a mailed one-time link — no ListDrop account needed. View-only; omit for the classic unlisted claim-link behavior."
    },
    "expires_in_days": {
      "type": "integer",
      "minimum": 1,
      "maximum": 365,
      "description": "Optional self-archive: after this many days the list becomes visible to its owner only (public lists unpublish, email gates close)."
    }
  },
  "$defs": {
    "ListItemInput": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 200,
          "description": "Item text; a URL inside is unfurled."
        },
        {
          "type": "object",
          "required": [
            "text"
          ],
          "properties": {
            "text": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "note": {
              "type": "string",
              "maxLength": 140,
              "description": "Short note shown under the item."
            }
          }
        }
      ]
    }
  }
}