Polls

Works on
  • iMessage

Send a poll, vote in one, and read every vote

A poll message asks a question with 2 to 12 choices. Votes come back as events you ask for, and your line can vote too.

Send a poll

curl -X POST https://api.mapier.ai/v1/commands/message.send \
  -H "Authorization: Bearer $MAPIER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: lunch-poll-1" \
  -H "x-mapier-version: 2026-12-01" \
  -d '{
    "target": { "conversationId": "a0000000-0000-4000-8000-000000000001" },
    "payload": { "kind": "poll", "question": "Where for lunch?", "options": ["Ramen", "Pho", "Tacos"] }
  }'
202 Accepted
{
  "commandId": "0192b3e1-…",
  "status": "queued",
  "repeated": false,
  "lineId": "0192a7b0-…",
  "lineSelection": "reused_active_chat",
  "channel": "imessage"
}

Limits

The question and each choice are 1 to 128 characters on one line, and each choice appears once. Nothing else goes beside them, not even text.

On iMessage a poll goes only into a conversation the person has written in, or a group chat.

Read the votes

Votes reach you only if you ask for them. Open the stream with ?events=polls, or subscribe a webhook to the events by name:

  1. poll.created when a poll appears, yours or the person's, with the id of each choice.
  2. poll.voted and poll.vote_cleared when someone votes or takes a vote back.
  3. poll.options_changed with the whole new list when someone adds a choice. Replace the list you hold.

Vote in a poll

Vote in a poll names the poll at payload.pollExternalId and the choice at payload.optionExternalId, both from poll.created. A vote adds a choice; it never takes one back.

Errors you may see

Each of these comes back at once, and nothing is sent.

ErrorMeansFix
422 validation_failedA question or choice is too long, or a choice is repeatedShorten it, and list each choice once
422 validation_failed, conversation_not_confirmedThe person has not written in this conversation yetSend a text first
404 unsupported_command, not_on_channelThe line's channel does not send pollsSend choices where the channel has them, or ask in a text

Next