Add or change a premiere poll
US Region: https://public-api.sessionboard.com · EU Region: https://public-api-eu.sessionboard.com
create adds a poll with a question and 2 to 6 answers; it opens at once and viewers see it. open, close and delete act on pollId. Requires write:marketing; refused for a key restricted to particular events. Also at POST /v1/marketing/video/premieres/{premiereId}/polls.
Request example
curl --request POST \ --url 'https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/video/premieres/{premiereId}/polls' \ --header 'x-access-token: <api-token>' \ --header 'Content-Type: application/json' \ --data '{ "action": "create", "pollId": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "question": "<string>", "options": [ "<string>" ]}'const response = await fetch('https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/video/premieres/{premiereId}/polls', { method: 'POST', headers: { "x-access-token": "<api-token>", "Content-Type": "application/json" }, body: JSON.stringify({ "action": "create", "pollId": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "question": "<string>", "options": [ "<string>" ] }),});
const data = await response.json();console.log(data);import requests
response = requests.request( "POST", "https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/video/premieres/{premiereId}/polls", headers={ "x-access-token": "<api-token>", "Content-Type": "application/json" }, json={ "action": "create", "pollId": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "question": "<string>", "options": [ "<string>" ] },)
print(response.json())<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/video/premieres/{premiereId}/polls", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => '{ "action": "create", "pollId": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "question": "<string>", "options": [ "<string>" ]}', CURLOPT_HTTPHEADER => [ "x-access-token: <api-token>", "Content-Type: application/json", ],]);
$response = curl_exec($curl);curl_close($curl);
echo $response;package main
import ( "fmt" "io" "net/http" "strings")
func main() { req, _ := http.NewRequest("POST", "https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/video/premieres/{premiereId}/polls", strings.NewReader(`{ "action": "create", "pollId": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "question": "<string>", "options": [ "<string>" ]}`)) req.Header.Add("x-access-token", "<api-token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/video/premieres/{premiereId}/polls")) .header("x-access-token", "<api-token>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{\n \"action\": \"create\",\n \"pollId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n}")) .build();
HttpResponse<String> response = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Try it
Response headers
Authorizations
x-access-tokenstringheaderOrganization API token. Generate from Organization Settings → API Tokens.
AuthorizationBearer <token>headerorOAuth 2.1 access token. Obtained via the OAuth PKCE flow at
/oauth/token.
Send one of these. See Authentication.
Path parameters
orgIdstringpathrequiredYour organization ID. Any other organization returns
404.premiereIdstring<uuid>pathrequiredThe premiere
Request body
actionstringrequired- Allowed values
"create", "open", "close", "delete"
pollIdstring<uuid>questionstring- Max length
300
optionsstring[]- Max items
6
{ "action": "create", "pollId": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "question": "<string>", "options": [ "<string>" ]}Responses
200
payload.poll with its answers and votes
400
A poll without a question or with fewer than 2 or more than 6 answers.
403
SCOPE_REQUIRED— the token lacksread:marketing(reads) orwrite:marketing(writes).ORG_WIDE_TOKEN_REQUIRED— the token is restricted to particular events; this operation reads the whole organization.FORBIDDEN— the organization's plan does not include Marketing, or the token's user cannot change goals (writes need an organization admin or the organization settings permission).
404
Not found in your organization.
