POST/api/v1/surveys| 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 |
|---|---|---|---|
| questions | Array | ✅ Yes | List of questions for the survey. Each question has headText, options, mandatoryFlag, and multipleSelectOptionFlag. |
| startTime | Number | ✅ Yes | Start time for the survey in Unix timestamp (ms). Can be a future date to schedule it. |
| endTime | Number | ✅ Yes | End time for the survey in Unix timestamp (ms). |
| communities | Array | ✅ Yes | Array of community IDs where the survey will be posted. |
| hideFromDiscover | Boolean | ❌ No | If true, hides the survey from being publicly discovered. |
{
"questions": [
{
"headText": "Who will win the Asia Cup 2028 ?",
"options": [
{ "text": "Bangladesh" },
{ "text": "China" },
{ "text": "India" }
],
"mandatoryFlag": true,
"multipleSelectOptionFlag": true
},
{
"headText": "Who will score more centuries ?",
"options": [
{ "text": "KL Rahul" },
{ "text": "Rishabh Pant" },
{ "text": "Shubman Gill" }
],
"mandatoryFlag": false,
"multipleSelectOptionFlag": false
}
],
"startTime": 1750825559000,
"endTime": 1751005739000,
"communities": ["67ce86c3d12a8800120030dd"],
"hideFromDiscover": true
}
{
"data": {
"surveyId": "685b7a9e43e21f0012ecb418",
"status": 1
},
"error": false,
"message": "Success"
}
| Field | Type | Description |
|---|---|---|
| surveyId | String | Unique identifier of the created survey. |
| status | Number | Status of creation (1 usually indicates success). |
startTime parameter allows scheduling the survey for a future date and time.multipleSelectOptionFlag lets you allow or restrict multiple answer selection per question.curl --location 'https://backend.networked.co/api/v1/surveys' \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"questions": [
{
"headText": "Who will win the Asia Cup 2028 ?",
"options": [
{
"text": "Bangladesh"
},
{
"text": "China"
},
{
"text": "India"
}
],
"mandatoryFlag": true,
"multipleSelectOptionFlag": true
},
{
"headText": "Who will score more centuries ?",
"options": [
{
"text": "KL Rahul"
},
{
"text": "Rishabh Pant"
},
{
"text": "Shubman Gill"
}
],
"mandatoryFlag": false,
"multipleSelectOptionFlag": false
}
],
"startTime": 1750825559000,
"endTime": 1751005739000,
"communities": [
"67959032bc6bea0012fdc671"
],
"hideFromDiscover": true
}'{
"data": {
"surveyId": "6874eef8fa1f513a3cb94c5e",
"status": 4
},
"error": false,
"message": "Operation completed successfully"
}