{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pollunit-com/json-schema/pollunit-com-option-list-item-schema.json",
  "title": "OptionListItem",
  "description": "Summary of a poll option as returned by the list endpoint. Fields are included conditionally depending on the poll's visibility settings and your access level (admin vs. member).",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pollunit-com-openapi.yml#/components/schemas/OptionListItem",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Option public_id"
    },
    "admin_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Admin access only"
    },
    "public_url": {
      "type": "string",
      "format": "uri"
    },
    "parent_option_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": "string",
      "description": "Option STI class"
    },
    "child_option_type": {
      "type": [
        "string",
        "null"
      ]
    },
    "content": {
      "type": [
        "string",
        "null"
      ]
    },
    "subtitle": {
      "type": [
        "string",
        "null"
      ]
    },
    "author_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "position": {
      "type": [
        "integer",
        "null"
      ]
    },
    "state": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "incoming",
        "investigation",
        "planned",
        "in_implementation",
        "rejected",
        "done"
      ],
      "description": "Collection polls only"
    },
    "rank": {
      "type": [
        "integer",
        "null"
      ]
    },
    "rating": {
      "type": [
        "number",
        "null"
      ],
      "format": "float"
    },
    "average_rating": {
      "type": [
        "number",
        "null"
      ],
      "format": "float"
    },
    "best_rating": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "selected": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "paid": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "info_link": {
      "type": [
        "string",
        "null"
      ]
    },
    "info_link_title": {
      "type": [
        "string",
        "null"
      ]
    },
    "is_other_answer": {
      "type": "boolean",
      "description": "The \"other\" option of a select input."
    },
    "start_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "end_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "approval_state": {
      "type": [
        "string",
        "null"
      ],
      "description": "Admin access only",
      "enum": [
        "unreviewed",
        "approved",
        "disapproved"
      ]
    },
    "approval_state_updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Admin access only"
    },
    "archived": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Admin access only"
    },
    "attachment": {
      "$ref": "#/$defs/OptionAttachment"
    }
  },
  "required": [
    "id",
    "type",
    "public_url"
  ],
  "$defs": {
    "OptionAttachment": {
      "type": [
        "object",
        "null"
      ],
      "description": "URLs of the file uploaded to the option, returned by both the list and the show endpoint. Only present for option types that carry an uploaded file (image, photo, audio, drawing and advent calendar options); youtube/vimeo and uploaded-video options do not have it. The `attachment_url_*` keys are the processed derivatives that exist for this file, so which ones are returned depends on the uploaded file: images and videos get `large`, `thumb` and `social`, an audio file only gets `cover` if it has embedded cover art, and a file that is still processing has none at all. The whole object is omitted when none of its keys apply, e.g. an option without a file or a still-processing upload you have no download access to.",
      "properties": {
        "attachment_url_large": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Long edge resized to 1920px (webp)."
        },
        "attachment_url_thumb": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Width resized to 496px (webp)."
        },
        "attachment_url_social": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Long edge resized to 1200px (jpg), used for social media previews."
        },
        "attachment_url_cover": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Cover art extracted from an audio file."
        },
        "attachment_original_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "The file as it was uploaded. Admin access only. For images and videos this falls back to the `large` derivative unless the account keeps source files."
        }
      }
    }
  }
}