X (Twitter) · JSON Structure

X Api Poll Structure

Represent a Poll attached to a Tweet.

Type: object Properties: 5 Required: 2
Social MediaMicrobloggingReal-Time DataStreamingAdvertisingContent

Poll is a JSON Structure definition published by X (Twitter), describing 5 properties, of which 2 are required. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.

Properties

duration_minutes end_datetime id options voting_status

Meta-schema: https://json-structure.org/meta/core/v0/#

JSON Structure

Raw ↑
{
  "$schema": "https://json-structure.org/meta/core/v0/#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/twitter/refs/heads/main/json-structure/x-api-poll-structure.json",
  "name": "Poll",
  "description": "Represent a Poll attached to a Tweet.",
  "type": "object",
  "properties": {
    "duration_minutes": {
      "type": "int32",
      "minimum": 5,
      "maximum": 10080
    },
    "end_datetime": {
      "type": "datetime"
    },
    "id": {
      "type": "string",
      "description": "Unique identifier of this poll.",
      "pattern": "^[0-9]{1,19}$",
      "example": "1365059861688410112"
    },
    "options": {
      "type": "array",
      "minItems": 2,
      "maxItems": 4,
      "items": {
        "$ref": "#/components/schemas/PollOption"
      }
    },
    "voting_status": {
      "type": "string",
      "enum": [
        "open",
        "closed"
      ]
    }
  },
  "required": [
    "id",
    "options"
  ]
}