Skip to main content
POST
Create option

Authorizations

Authorization
string
header
required

Personal API token — find yours under My Account → API.

Headers

X-POLLUNIT-USER-IDENTIFIER
string

Your own identification of the user on whose behalf the request is made, any string. The user identifiers should not be guessable and stay secret, otherwise users could get access to other users' contents. Only used with a public API token: the created or changed object belongs to that anonymous user instead of the token owner, which keeps the user in control of it in later requests with the same identifier.

Path Parameters

poll_id
string
required

Poll member_hash or admin_hash

Query Parameters

organization_id
string

public_id of an organization the user belongs to. When given, the request runs in that organization context instead of the personal account.

Body

option
object
required

Attributes accepted when creating or updating an option. The option class is derived from the poll (or from the parent option for nested options) and cannot be set through the API.

parent_option_id
string | null

public_id of the parent option (survey step, option category or photo group). Omit to create a top level option.

additional_attributes
object | null

Values for the poll's additional_option_attributes.

terms
enum<string> | null

Set to 1 to accept the poll's terms.

Available options:
0,
1
privacy_policy
enum<string> | null

Set to 1 to accept the poll's privacy policy.

Available options:
0,
1

Response

child option created

Full representation of a single poll option. Top-level fields vary by option type and are included conditionally depending on the poll's visibility settings and your access level (admin vs. member); type-specific configuration is grouped under settings.

id
string
required

Option public_id

public_url
string<uri>
required
type
string
required

Option STI class

Example:

"Options::TextOption"

admin_url
string<uri> | null

Admin access only

parent_option_id
string | null
content
string | null
subtitle
string | null
description
string | null
author_name
string | null
position
integer | null
state
enum<string> | null

Collection polls only

Available options:
incoming,
investigation,
planned,
in_implementation,
rejected,
done
rank
integer | null
rating
number<float> | null
average_rating
number<float> | null
best_rating
boolean | null
selected
boolean | null
child_option_type
string | null
data
object | null

Option-type-specific payload (e.g. location_data for location options)

drawing_type
enum<string> | null
Available options:
free_sketch,
sign,
draw_on_image
input_type
enum<string> | null

Input options only

Available options:
text,
textarea,
email,
url,
select,
radio,
multi_select,
checkbox,
number,
number_float,
file,
date,
datetime
location_type
enum<string> | null
Available options:
point,
route,
polygon,
circle,
rectangle
options_count
integer | null
paid
boolean | null
privacy_policy_accepted
boolean | null
processing
boolean | null
rotation
integer | null
terms_accepted
boolean | null
start_date
string<date-time> | null
end_date
string<date-time> | null
created_at
string<date-time> | null
updated_at
string<date-time> | null
video_thumb_path
string | null
vimeo_id
string | null
youtube_id
string | null
voter_count
integer | null
settings
object

Option-type-specific configuration, grouped for readability.

attachment
object | null

URLs of the file uploaded to the option, returned by both the list and the show endpoint. Only present for option types that carry an uploaded file (image, photo, audio, drawing and advent calendar options); youtube/vimeo and uploaded-video options do not have it. The attachment_url_* keys are the processed derivatives that exist for this file, so which ones are returned depends on the uploaded file: images and videos get large, thumb and social, an audio file only gets cover if it has embedded cover art, and a file that is still processing has none at all. The whole object is omitted when none of its keys apply, e.g. an option without a file or a still-processing upload you have no download access to.

approval_state
enum<string> | null

Admin access only

Available options:
unreviewed,
approved,
disapproved
approval_state_updated_at
string<date-time> | null

Admin access only

archived
boolean | null

Admin access only

fraudulent_count
integer | null

Admin access only

state_change_message
string | null

Admin access only