/api/surveys/aggregate
Get aggregated survey answers for all users for analytics and graphing (requires authentication and admin access)
Headers:
Authorization: Bearer ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr...
Response (200 OK):
{
"count": 5,
"questions": [
{
"id": 1,
"type": "MOPT",
"name": "What LMW resources are you using? (Select all that apply.)",
"sortOrder": 1,
"totalResponses": 150,
"options": [
{
"id": 1,
"label": "Print Resources",
"value": "print_resources",
"sortOrder": 1,
"count": 85
},
{
"id": 2,
"label": "LMW App",
"value": "lmw_app",
"sortOrder": 2,
"count": 120
},
{
"id": 3,
"label": "Olive Tree",
"value": "olive_tree",
"sortOrder": 3,
"count": 45
},
{
"id": 10,
"label": "Other",
"value": "other",
"sortOrder": 10,
"count": 12
}
]
},
{
"id": 2,
"type": "BOOL",
"name": "Are you a first time user in the last 12 months?",
"sortOrder": 2,
"totalResponses": 150,
"trueCount": 95,
"falseCount": 55
},
{
"id": 3,
"type": "OPTI",
"name": "How do you intend to use the material?",
"sortOrder": 3,
"totalResponses": 148,
"options": [
{
"id": 11,
"label": "Preach (I hold a formal role in the church)",
"value": "preach",
"sortOrder": 1,
"count": 62
},
{
"id": 12,
"label": "Teach (I teach in an informal capacity)",
"value": "teach",
"sortOrder": 2,
"count": 48
},
{
"id": 13,
"label": "Disciple (I am meeting 1 on 1 with others to help them grow)",
"value": "disciple",
"sortOrder": 3,
"count": 23
},
{
"id": 14,
"label": "Personal Use (I am using this resource for my own time of study)",
"value": "personal_use",
"sortOrder": 4,
"count": 15
}
]
}
]
}
Error Responses:
{
"message": "User not authenticated"
}
{
"message": "Administrator access required"
}
Notes:
options - Array of options with selection countscount - Number of users who selected this specific optiontrueCount - Number of users who answered "yes" (true, 1, yes)falseCount - Number of users who answered "no" (false, 0, no)sum - Sum of all numeric responsesaverage - Average of all numeric responsesmin - Minimum value providedmax - Maximum value providedtotalResponses is provided (count of users who answered)totalResponses - Total number of users who provided an answer to this question/api/surveys/questions
Get all active survey questions with their options (requires authentication)
Headers:
Authorization: Bearer ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr...
Response (200 OK):
{
"count": 5,
"questions": [
{
"id": 1,
"type": "MOPT",
"name": "What LMW resources are you using? (Select all that apply.)",
"sortOrder": 1,
"isActive": true,
"options": [
{
"id": 1,
"label": "Print Resources",
"value": "print_resources",
"sortOrder": 1
},
{
"id": 2,
"label": "LMW App",
"value": "lmw_app",
"sortOrder": 2
},
{
"id": 3,
"label": "Olive Tree",
"value": "olive_tree",
"sortOrder": 3
},
{
"id": 4,
"label": "LOGOS",
"value": "logos",
"sortOrder": 4
},
{
"id": 5,
"label": "Accordance",
"value": "accordance",
"sortOrder": 5
},
{
"id": 6,
"label": "e-Sword",
"value": "esword",
"sortOrder": 6
},
{
"id": 7,
"label": "WD Bible",
"value": "wd_bible",
"sortOrder": 7
},
{
"id": 8,
"label": "YouVersion (Plans)",
"value": "youversion_plans",
"sortOrder": 8
},
{
"id": 9,
"label": "USB Flash Drive",
"value": "usb_flash_drive",
"sortOrder": 9
},
{
"id": 10,
"label": "Other",
"value": "other",
"sortOrder": 10
}
]
},
{
"id": 2,
"type": "BOOL",
"name": "Are you a first time user in the last 12 months?",
"sortOrder": 2,
"isActive": true,
"options": []
},
{
"id": 3,
"type": "OPTI",
"name": "How do you intend to use the material?",
"sortOrder": 3,
"isActive": true,
"options": [
{
"id": 11,
"label": "Preach (I hold a formal role in the church)",
"value": "preach",
"sortOrder": 1
},
{
"id": 12,
"label": "Teach (I teach in an informal capacity)",
"value": "teach",
"sortOrder": 2
},
{
"id": 13,
"label": "Disciple (I am meeting 1 on 1 with others to help them grow)",
"value": "disciple",
"sortOrder": 3
},
{
"id": 14,
"label": "Personal Use (I am using this resource for my own time of study)",
"value": "personal_use",
"sortOrder": 4
}
]
},
{
"id": 4,
"type": "OPTI",
"name": "What barriers are there for you in gaining access to theologically sound resources?",
"sortOrder": 4,
"isActive": true,
"options": [
{
"id": 15,
"label": "Accessibility (I do not have access to print or digital resources in my language)",
"value": "accessibility",
"sortOrder": 1
},
{
"id": 16,
"label": "Usability (I do not know how to access or use materials at my disposal)",
"value": "usability",
"sortOrder": 2
},
{
"id": 17,
"label": "None",
"value": "none",
"sortOrder": 3
}
]
},
{
"id": 5,
"type": "OPTI",
"name": "What level of training have you received, if any?",
"sortOrder": 5,
"isActive": true,
"options": [
{
"id": 18,
"label": "Formal (I have received seminary training from an accredited institution) (5% of pastors globally have received formal training).",
"value": "formal",
"sortOrder": 1
},
{
"id": 19,
"label": "Non-Formal (I have received skill-based training from a pastoral trainer or bible teacher, whether in person or online)",
"value": "non_formal",
"sortOrder": 2
},
{
"id": 20,
"label": "In-Formal (I have been discipled by a pastor or leader of an older age that has encouraged me in my personal walk)",
"value": "informal",
"sortOrder": 3
},
{
"id": 21,
"label": "None",
"value": "none_training",
"sortOrder": 4
}
]
}
]
}
Error Responses:
{
"message": "User not authenticated"
}
Notes:
/api/surveys/users/:userId/answers
Get all survey answers for a specific user (requires authentication and admin access)
Headers:
Authorization: Bearer ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr...
URL Parameters:
userId (required) - The ID of the user whose survey answers to retrieveResponse (200 OK):
{
"userId": 123,
"count": 5,
"answers": [
{
"id": 1,
"userId": 123,
"surveyQuestionId": 1,
"questionName": "What LMW resources are you using? (Select all that apply.)",
"questionType": "MOPT",
"value": "lmw_app,print_resources",
"answeredAt": "2026-02-15T10:30:00.000Z",
"options": [
{
"id": 1,
"label": "Print Resources",
"value": "print_resources",
"sortOrder": 1
},
{
"id": 2,
"label": "LMW App",
"value": "lmw_app",
"sortOrder": 2
},
{
"id": 3,
"label": "Olive Tree",
"value": "olive_tree",
"sortOrder": 3
},
{
"id": 10,
"label": "Other",
"value": "other",
"sortOrder": 10
}
]
},
{
"id": 2,
"userId": 123,
"surveyQuestionId": 2,
"questionName": "Are you a first time user in the last 12 months?",
"questionType": "BOOL",
"value": "true",
"answeredAt": "2026-02-15T10:30:05.000Z"
},
{
"id": 3,
"userId": 123,
"surveyQuestionId": 3,
"questionName": "How do you intend to use the material?",
"questionType": "OPTI",
"value": "preach",
"answeredAt": "2026-02-15T10:30:10.000Z",
"options": [
{
"id": 11,
"label": "Preach (I hold a formal role in the church)",
"value": "preach",
"sortOrder": 1
},
{
"id": 12,
"label": "Teach (I teach in an informal capacity)",
"value": "teach",
"sortOrder": 2
},
{
"id": 13,
"label": "Disciple (I am meeting 1 on 1 with others to help them grow)",
"value": "disciple",
"sortOrder": 3
},
{
"id": 14,
"label": "Personal Use (I am using this resource for my own time of study)",
"value": "personal_use",
"sortOrder": 4
}
]
},
{
"id": 4,
"userId": 123,
"surveyQuestionId": 4,
"questionName": "What barriers are there for you in gaining access to theologically sound resources?",
"questionType": "OPTI",
"value": "accessibility",
"answeredAt": "2026-02-15T10:30:15.000Z",
"options": [
{
"id": 15,
"label": "Accessibility (I do not have access to print or digital resources in my language)",
"value": "accessibility",
"sortOrder": 1
},
{
"id": 16,
"label": "Usability (I do not know how to access or use materials at my disposal)",
"value": "usability",
"sortOrder": 2
},
{
"id": 17,
"label": "None",
"value": "none",
"sortOrder": 3
}
]
},
{
"id": 5,
"userId": 123,
"surveyQuestionId": 5,
"questionName": "What level of training have you received, if any?",
"questionType": "OPTI",
"value": "non_formal",
"answeredAt": "2026-02-15T10:30:20.000Z",
"options": [
{
"id": 18,
"label": "Formal (I have received seminary training from an accredited institution) (5% of pastors globally have received formal training).",
"value": "formal",
"sortOrder": 1
},
{
"id": 19,
"label": "Non-Formal (I have received skill-based training from a pastoral trainer or bible teacher, whether in person or online)",
"value": "non_formal",
"sortOrder": 2
},
{
"id": 20,
"label": "In-Formal (I have been discipled by a pastor or leader of an older age that has encouraged me in my personal walk)",
"value": "informal",
"sortOrder": 3
},
{
"id": 21,
"label": "None",
"value": "none_training",
"sortOrder": 4
}
]
}
]
}
Error Responses:
{
"message": "User not authenticated"
}
{
"message": "Administrator access required"
}
{
"message": "Invalid user ID"
}
Notes:
options arrayoptions field/api/surveys/answers
Submit survey answers for the authenticated user (requires authentication)
Headers:
Authorization: Bearer ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr...
Request Body:
{
"answers": [
{
"questionId": 1,
"value": "lmw_app,print_resources"
},
{
"questionId": 2,
"value": "true"
},
{
"questionId": 3,
"value": "preach"
}
]
}
Response (201 Created):
{
"message": "Survey answers submitted successfully",
"count": 3,
"answers": [
{
"id": 1,
"userId": 123,
"surveyQuestionId": 1,
"questionName": "",
"questionType": "",
"value": "lmw_app,print_resources",
"answeredAt": "2026-02-20T10:30:00.000Z"
},
{
"id": 2,
"userId": 123,
"surveyQuestionId": 2,
"questionName": "",
"questionType": "",
"value": "true",
"answeredAt": "2026-02-20T10:30:00.000Z"
},
{
"id": 3,
"userId": 123,
"surveyQuestionId": 3,
"questionName": "",
"questionType": "",
"value": "preach",
"answeredAt": "2026-02-20T10:30:00.000Z"
}
]
}
Error Responses:
{
"message": "User not authenticated"
}
{
"message": "Invalid request body. Expected 'answers' array"
}
{
"message": "No answers provided"
}
{
"message": "Invalid questionId at index 0. Expected a number"
}
{
"message": "Missing value at index 0"
}
{
"message": "Invalid or inactive question ID: 999"
}
{
"message": "Empty value provided for question ID: 1"
}
Notes:
answers array with at least one answerquestionId (number) - The ID of the survey question being answeredvalue (string) - The answer valueansweredAt timestamp is automatically set to the current time