> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trychert.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Polls

> Send a poll and read its votes.

<Note>Polls are available on enabled lines. Send a message first, then use its `chat_id`. Unsupported lines return `422` with code `4099`.</Note>

### Create a poll

`POST /api/v1/polls`

```bash theme={null}
curl -X POST https://console.trychert.com/api/v1/polls \
  -H "Authorization: Bearer $CHERT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "YOUR_CHAT_ID",
    "title": "What would you like help with?",
    "options": ["Getting started", "Finding people", "Something else"],
    "idempotency_key": "onboarding-question-1"
  }'
```

Use 2–12 distinct options (up to 100 characters each) and a title up to 256 characters. `idempotency_key` is required: reuse it for retries, and use a new key for each new poll. Include `x-chert-tenant` if your key requires it.

### Read answers

`GET /api/v1/polls/{id}` — use the poll `id` returned by creation.

Both endpoints return `id`, `chat_id`, `phone_line_id`, `message_guid`, `title`, `options` (`id`, `text`, `vote_count`), `votes` (`option_id`, `voter`), and `total_voters`. Repeating creation returns the original result; GET returns current votes, including changes and removals. Only your tenant's polls are accessible.

For onboarding, check GET periodically while waiting for an answer. Vote-change webhooks and closing polls are not supported yet. Rendering depends on the recipient's Messages version.

Invalid input returns `400`; an unknown chat or poll returns `404`; reusing a key with different content returns `409`. For retryable errors, retry with the **same** key. See [Errors](/api/errors).
