Update Voting Session
curl --request PATCH \
--url https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expires_in_hours": 4380,
"instructions": "<string>",
"is_active": true,
"max_seats": 2,
"max_votes_per_voter": 2,
"spend_cap_credits": 2,
"total_vote_limit": 2
}
'import requests
url = "https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id}"
payload = {
"expires_in_hours": 4380,
"instructions": "<string>",
"is_active": True,
"max_seats": 2,
"max_votes_per_voter": 2,
"spend_cap_credits": 2,
"total_vote_limit": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expires_in_hours: 4380,
instructions: '<string>',
is_active: true,
max_seats: 2,
max_votes_per_voter: 2,
spend_cap_credits: 2,
total_vote_limit: 2
})
};
fetch('https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expires_in_hours' => 4380,
'instructions' => '<string>',
'is_active' => true,
'max_seats' => 2,
'max_votes_per_voter' => 2,
'spend_cap_credits' => 2,
'total_vote_limit' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id}"
payload := strings.NewReader("{\n \"expires_in_hours\": 4380,\n \"instructions\": \"<string>\",\n \"is_active\": true,\n \"max_seats\": 2,\n \"max_votes_per_voter\": 2,\n \"spend_cap_credits\": 2,\n \"total_vote_limit\": 2\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <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))
}HttpResponse<String> response = Unirest.patch("https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expires_in_hours\": 4380,\n \"instructions\": \"<string>\",\n \"is_active\": true,\n \"max_seats\": 2,\n \"max_votes_per_voter\": 2,\n \"spend_cap_credits\": 2,\n \"total_vote_limit\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires_in_hours\": 4380,\n \"instructions\": \"<string>\",\n \"is_active\": true,\n \"max_seats\": 2,\n \"max_votes_per_voter\": 2,\n \"spend_cap_credits\": 2,\n \"total_vote_limit\": 2\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"experiment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"max_seats": 123,
"max_votes_per_voter": 123,
"name": "<string>",
"revoked_at": "2023-11-07T05:31:56Z",
"token": "<string>",
"total_votes": 123,
"unique_voters": 123,
"voting_url": "<string>",
"audience": "public",
"instructions": "<string>",
"non_choice_responses": 0,
"paused_at": "2023-11-07T05:31:56Z",
"spend_cap_credits": 123,
"spend_spent_credits": 0,
"spend_used": 0,
"status": "active",
"total_vote_limit": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Voting Sessions
Update Voting Session
Update voting session limits (e.g., max seats).
PATCH
/
v1
/
experiments
/
{experiment_id}
/
voting-sessions
/
{session_id}
Update Voting Session
curl --request PATCH \
--url https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expires_in_hours": 4380,
"instructions": "<string>",
"is_active": true,
"max_seats": 2,
"max_votes_per_voter": 2,
"spend_cap_credits": 2,
"total_vote_limit": 2
}
'import requests
url = "https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id}"
payload = {
"expires_in_hours": 4380,
"instructions": "<string>",
"is_active": True,
"max_seats": 2,
"max_votes_per_voter": 2,
"spend_cap_credits": 2,
"total_vote_limit": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expires_in_hours: 4380,
instructions: '<string>',
is_active: true,
max_seats: 2,
max_votes_per_voter: 2,
spend_cap_credits: 2,
total_vote_limit: 2
})
};
fetch('https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expires_in_hours' => 4380,
'instructions' => '<string>',
'is_active' => true,
'max_seats' => 2,
'max_votes_per_voter' => 2,
'spend_cap_credits' => 2,
'total_vote_limit' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id}"
payload := strings.NewReader("{\n \"expires_in_hours\": 4380,\n \"instructions\": \"<string>\",\n \"is_active\": true,\n \"max_seats\": 2,\n \"max_votes_per_voter\": 2,\n \"spend_cap_credits\": 2,\n \"total_vote_limit\": 2\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <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))
}HttpResponse<String> response = Unirest.patch("https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expires_in_hours\": 4380,\n \"instructions\": \"<string>\",\n \"is_active\": true,\n \"max_seats\": 2,\n \"max_votes_per_voter\": 2,\n \"spend_cap_credits\": 2,\n \"total_vote_limit\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heybee.app/v1/experiments/{experiment_id}/voting-sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires_in_hours\": 4380,\n \"instructions\": \"<string>\",\n \"is_active\": true,\n \"max_seats\": 2,\n \"max_votes_per_voter\": 2,\n \"spend_cap_credits\": 2,\n \"total_vote_limit\": 2\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"experiment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"max_seats": 123,
"max_votes_per_voter": 123,
"name": "<string>",
"revoked_at": "2023-11-07T05:31:56Z",
"token": "<string>",
"total_votes": 123,
"unique_voters": 123,
"voting_url": "<string>",
"audience": "public",
"instructions": "<string>",
"non_choice_responses": 0,
"paused_at": "2023-11-07T05:31:56Z",
"spend_cap_credits": 123,
"spend_spent_credits": 0,
"spend_used": 0,
"status": "active",
"total_vote_limit": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
BearerAuthApiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Update a voting session (owner only).
Reset expiry relative to now. Explicit null means no expiry.
Required range:
1 <= x <= 8760Instructions shown to voters on this voting link. Explicit null means no instructions.
Maximum string length:
4000Pause or resume the voting link.
New max seats (must be >= active seats). Explicit null means unlimited.
Required range:
x >= 1New max votes per seat. Explicit null means unlimited.
Required range:
x >= 1New spend cap in credits. Explicit null means unlimited.
Required range:
x >= 1New total counted vote limit. Explicit null means unlimited.
Required range:
x >= 1Response
Successful Response
Response for a voting session.
Available options:
public, internal 
