Skip to API content
TalkLabs API Docs v3
Recipes
POST Polls

Create or Update Choice

Use this method to create or update a poll choice.

POST /api/v3/{appid}/poll/poll/{pollid}/choice

This method requires authentication.

Use this method to create or update a poll choice. This method will return all choices with their positions updated so that they can be displayed correctly in an editor. When utilizing random sort order, that will be applied when requesting the poll details

* id: (optional) If specified, the poll choice with this ID will be updated
* position: (optional, default = -1) The position of the choice in the list of choices. By default a new choice is added to the end of the list of choices. If you specify a position, the choice is moved to that position and any other choices there or after that position are moved up one position index.
* title: (optional) This is the text displayed with the choice.
* imageurl: (optional) You can use this field to set the URL for an image
* videoid: (optional) A field to store the ID of a video
* embedcode: (optional) Store content that can be used to display the choice.
* vidoeurl: (optional) This field may be used to store the URL for a video
* customid: (optional) A customid for the room. Can be unused, or a unique key.
* customtype : (optional) Custom type string.
* custompayload : (optional) Custom payload string.
* customfield1 : (optional) User custom field 1. Store any string value you want here, limit 1024 bytes.
* customfield2 : (optional) User custom field 2. Store any string value you want here, limit 1024 bytes.
* customtags : (optional) A comma delimited list of tags
* private: (false | optional) If set to true a user cannot join this room unless explicitly granted with a call to the Set User Permission API.

Request

Parameters

Values in the path and query string.

appid path
string TalkLabs ID required

The TalkLabs application ID assigned to your account.

Example: your-app-id
pollid path
string TalkLabs ID required

The TalkLabs assigned poll ID.

Example: poll-id
Request

JSON body

Send as application/json.

id
string
pollID
string TalkLabs ID

The TalkLabs assigned poll ID.

position
integer · int32
title
string
subtitle
string
imageUrl
string
videoID
string
embedCode
string
customType
string
customId
string customer-defined

A customer defined ID chosen by your application. TalkLabs stores it so you can retrieve the resource without keeping its TalkLabs ID.

customPayload
string
customField1
string
customField2
string
customTags
string[]
Request example
{
  "position": -1,
  "title": "Red"
}
Response

Status codes

Every JSON response uses the API result envelope.

200 OK ApiResult
400 Bad Request ApiResult
403 Forbidden ApiResult
500 Internal Server Error ApiResult
Example response · 200
{
  "message": "Success",
  "errors": {},
  "data": [
    {
      "kind": "poll.choice",
      "id": "662da22ee45ad80a7f2bd951",
      "appid": "662bb49bf10e9a26a7e8ed92",
      "pollid": "662da20fe45ad80a7f2bd950",
      "position": 0,
      "title": "Red",
      "imageurl": "",
      "videoid": "",
      "embedcode": "",
      "customtype": "",
      "customid": "",
      "custompayload": "",
      "customtags": null,
      "customfield1": "",
      "customfield2": ""
    }
  ]
}
Search all 118 endpoints Try “join room”, “moderate”, or “POST”.
Request environment

Connect your application

These values fill request examples and the API console. They stay in this browser tab and are never sent to TalkLabs until you run a request.

Credentials are stored in sessionStorage, not in cookies or analytics.