{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codai-ro/json-schema/codai-ro-list-item-schema.json",
  "title": "ListItem",
  "description": "One item of a list.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codai-ro-lists-api-openapi.yml#/components/schemas/ListItem",
  "type": "object",
  "required": [
    "id",
    "list_id",
    "client_id",
    "kind",
    "title",
    "body",
    "url",
    "media_key",
    "mime",
    "enrichment",
    "source",
    "pinned",
    "done",
    "remind_at",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "list_id": {
      "type": "string",
      "format": "uuid"
    },
    "client_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "type": "string",
      "enum": [
        "text",
        "link",
        "product",
        "media",
        "file"
      ]
    },
    "title": {
      "type": [
        "string",
        "null"
      ]
    },
    "body": {
      "type": [
        "string",
        "null"
      ]
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "media_key": {
      "type": [
        "string",
        "null"
      ]
    },
    "mime": {
      "type": [
        "string",
        "null"
      ]
    },
    "enrichment": {
      "$ref": "#/$defs/ListItemEnrichment"
    },
    "source": {
      "$ref": "#/$defs/ListItemSource"
    },
    "pinned": {
      "type": "boolean"
    },
    "done": {
      "type": "boolean"
    },
    "remind_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "ListItemEnrichment": {
      "type": "object",
      "description": "Filled in the background by link unfurling, the Inbox suggestion and the price watch. Every field is optional.",
      "properties": {
        "siteName": {
          "type": "string"
        },
        "image": {
          "type": "string",
          "format": "uri",
          "description": "Preview image URL; read it through `GET /v1/lists/items/{itemId}/image`."
        },
        "description": {
          "type": "string"
        },
        "price": {
          "type": "object",
          "required": [
            "amount",
            "currency"
          ],
          "properties": {
            "amount": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            }
          }
        },
        "availability": {
          "type": "string",
          "enum": [
            "in_stock",
            "out_of_stock",
            "preorder",
            "unknown"
          ]
        },
        "suggestedListId": {
          "type": "string",
          "format": "uuid",
          "description": "Inbox auto-sort, the list the model suggested; you confirm it by moving the item."
        },
        "fetchedAt": {
          "type": "string",
          "format": "date-time"
        },
        "watchedAt": {
          "type": "string",
          "format": "date-time"
        },
        "error": {
          "type": "string"
        }
      }
    },
    "ListItemSource": {
      "type": "object",
      "additionalProperties": false,
      "description": "Where the item came from.",
      "properties": {
        "app": {
          "type": "string",
          "maxLength": 120
        },
        "device": {
          "type": "string",
          "maxLength": 120
        },
        "surface": {
          "type": "string",
          "enum": [
            "phone",
            "desktop",
            "hub",
            "mcp",
            "cli",
            "wear",
            "api"
          ]
        }
      }
    }
  }
}