Send a poll
curl --request POST \
--url https://osis.co/api/v1/comms/polls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"conversation_id": "<string>",
"contact_id": "<string>",
"question": "<string>",
"options": [
"<string>"
],
"default_country": "<string>"
}
'import requests
url = "https://osis.co/api/v1/comms/polls"
payload = {
"to": "<string>",
"conversation_id": "<string>",
"contact_id": "<string>",
"question": "<string>",
"options": ["<string>"],
"default_country": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
conversation_id: '<string>',
contact_id: '<string>',
question: '<string>',
options: ['<string>'],
default_country: '<string>'
})
};
fetch('https://osis.co/api/v1/comms/polls', 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://osis.co/api/v1/comms/polls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '<string>',
'conversation_id' => '<string>',
'contact_id' => '<string>',
'question' => '<string>',
'options' => [
'<string>'
],
'default_country' => '<string>'
]),
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://osis.co/api/v1/comms/polls"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"default_country\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://osis.co/api/v1/comms/polls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"default_country\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://osis.co/api/v1/comms/polls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"default_country\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyMessages
Send a poll
POST /api/v1/comms/polls — send a native iMessage poll.
POST
https://osis.co
/
api
/
v1
/
comms
/
polls
Send a poll
curl --request POST \
--url https://osis.co/api/v1/comms/polls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"conversation_id": "<string>",
"contact_id": "<string>",
"question": "<string>",
"options": [
"<string>"
],
"default_country": "<string>"
}
'import requests
url = "https://osis.co/api/v1/comms/polls"
payload = {
"to": "<string>",
"conversation_id": "<string>",
"contact_id": "<string>",
"question": "<string>",
"options": ["<string>"],
"default_country": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
conversation_id: '<string>',
contact_id: '<string>',
question: '<string>',
options: ['<string>'],
default_country: '<string>'
})
};
fetch('https://osis.co/api/v1/comms/polls', 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://osis.co/api/v1/comms/polls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '<string>',
'conversation_id' => '<string>',
'contact_id' => '<string>',
'question' => '<string>',
'options' => [
'<string>'
],
'default_country' => '<string>'
]),
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://osis.co/api/v1/comms/polls"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"default_country\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://osis.co/api/v1/comms/polls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"default_country\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://osis.co/api/v1/comms/polls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"question\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"default_country\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySend a native iMessage poll. On iOS 26 and later it lands as tappable choices. Older iPhones show the fallback “Sent a poll”.
Polls are iMessage-only. SMS is rejected.
Scope:
Hosted Comms agents can also send this with the
comms_send
Request
curl -X POST "https://osis.co/api/v1/comms/polls" \
-H "Authorization: Bearer $COMMS_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: poll-lunch-4242" \
-d '{
"to": "+12125550147",
"question": "Where should we eat?",
"options": ["Pizza", "Sushi", "Tacos"]
}'
Body parameters
string
E.164 destination. Required unless
conversation_id or contact_id is set.string
Existing conversation to continue. Required unless
to or contact_id is set.string
Existing contact. Required unless
to or conversation_id is set.string
required
Poll question. Max 200 characters.
string[]
required
Two to twelve distinct choices. Each option is at most 80 characters.
string
ISO country code used only when
to is a national-format number.Response
Same envelope as Send a message, pluspoll.
{
"message": {
"id": "msg_01HZX…",
"conversation_id": "conv_01HZX…",
"contact_id": "ctc_01HZX…",
"direction": "outbound",
"channel": "imessage",
"body": "Where should we eat?",
"status": "sent"
},
"poll": {
"question": "Where should we eat?",
"options": ["Pizza", "Sushi", "Tacos"]
}
}
send_poll tool.
When a contact votes, Comms records an inbound message such as Voted "Pizza" on "Lunch?" and emits comms.poll.voted. A native tap vote includes the chosen option when the line receives the vote payload; a text reply that matches an option or its number is treated the same way.⌘I