POST/api/v1/polls| Name | Type | Required | Description |
|---|---|---|---|
| x-api-key | String | ✅ Yes | Secret API key provided by Networked. Required for all API calls. |
| spaceId | String | ❌ No | Required only if the poll is intended for a Space. Otherwise, defaults to Community Feed. |
| Name | Type | Required | Description |
|---|---|---|---|
| headText | String | ✅ Yes | The main question of the poll. |
| options | Array | ✅ Yes | List of options for the poll. Each must contain a key and text. |
| startTime | Number | ✅ Yes | Poll start time in Unix timestamp (milliseconds). |
| endTime | Number | ✅ Yes | Poll end time in Unix timestamp (milliseconds). |
| communities | Array | ✅ Yes | List of community IDs where the poll will be posted. |
| hideFromDiscover | Boolean | ❌ No | If true, hides the poll from discovery/public feeds. |
{
"headText": "What is the first month of an year ?",
"options": [
{ "key": 0, "text": "March" },
{ "key": 1, "text": "January" },
{ "key": 2, "text": "April" }
],
"startTime": 1750822340000,
"endTime": 1750916120000,
"communities": ["67ce86c3d12a8800120030dd"],
"hideFromDiscover": true
}
{
"data": {
"pollId": "685b750443e21f0012ecb365",
"status": 1
},
"error": false,
"message": "Success"
}
| Field | Type | Description |
|---|---|---|
| pollId | String | Unique identifier for the created poll. |
| status | Number | Status of poll creation (typically 1 = successful). |
curl --location 'https://backend.networked.co/api/v1/polls' \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"headText": "What is the first month of an year ?",
"options": [
{
"key": 0,
"text": "March"
},
{
"key": 1,
"text": "January"
},
{
"key": 2,
"text": "April"
}
],
"startTime": 1750822340000,
"endTime": 1750916120000,
"communities": [
"67959032bc6bea0012fdc671"
],
"hideFromDiscover": true
}'{
"data": {
"pollId": "6874eeb6fa1f513a3cb94c37",
"status": 4
},
"error": false,
"message": "Operation completed successfully"
}