Create a poll
This action creates a poll with at least one option. You can configure various settings for your poll, including when the poll will close and whether to allow voting for multiple options.
After creating a poll, to share the poll with other users in a channel, the poll must be sent as a message.
HTTP request
Request body
The following table lists the properties that this action supports.
Parameters
Required | Type | Description |
---|---|---|
title | string | Specifies the title of a poll. The length is limited to 2,048 characters. |
options | array of strings | Specifies an array of poll options that a user can vote for. At least one option should be provided, and the length of each option is limited to 2,000 characters. |
Optional | Type | Description |
---|---|---|
allow_user_suggestion | boolean | Determines whether to allow users other than the creator of the poll to add new options to the poll. (Default: |
allow_multiple_votes | boolean | Determines whether to allow users to vote for multiple options. (Default: |
close_at | long | Specifies when the poll closes and no longer accepts votes in Unix seconds. If the value of this property is |
created_by | string | Specifies the unique ID of the user who creates the poll. |
data | object | Specifies a JSON object of one or more key-value items to store additional poll information. |
Response
If successful, this action returns a poll resource in the response body.
In the case of an error, an error object is returned. A detailed list of error codes is available here.