# app.protoimsg.chat.poll

> Published by [lexicons.protoimsg.app](https://lexicon.garden/identity/did:plc:xk3xpcauatfephlieonmluh4)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:xk3xpcauatfephlieonmluh4/app.protoimsg.chat.poll)
- [Documentation](https://lexicon.garden/lexicon/did:plc:xk3xpcauatfephlieonmluh4/app.protoimsg.chat.poll/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:xk3xpcauatfephlieonmluh4/app.protoimsg.chat.poll/examples)

## Definitions

### `app.protoimsg.chat.poll`

**Type**: `record`

A poll within a chat channel. Lives in the creator's repo.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `channel` | `string` (at-uri) | Yes | AT-URI of the channel this poll belongs to. |
| `options` | `array` | Yes | Poll answer options. |
| `question` | `string` | Yes | The poll question. |
| `createdAt` | `string` (datetime) | Yes | Timestamp of poll creation. |
| `expiresAt` | `string` (datetime) | No | When the poll closes. Omit for no expiry. |
| `allowMultiple` | `boolean` | No | Whether voters can select multiple options. |

## Raw Schema

```json
{
  "id": "app.protoimsg.chat.poll",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "channel",
          "question",
          "options",
          "createdAt"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "format": "at-uri",
            "description": "AT-URI of the channel this poll belongs to."
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 100
            },
            "maxLength": 10,
            "minLength": 2,
            "description": "Poll answer options."
          },
          "question": {
            "type": "string",
            "maxLength": 200,
            "description": "The poll question."
          },
          "createdAt": {
            "type": "string",
            "format": "datetime",
            "description": "Timestamp of poll creation."
          },
          "expiresAt": {
            "type": "string",
            "format": "datetime",
            "description": "When the poll closes. Omit for no expiry."
          },
          "allowMultiple": {
            "type": "boolean",
            "default": false,
            "description": "Whether voters can select multiple options."
          }
        }
      },
      "description": "A poll within a chat channel. Lives in the creator's repo."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
