Quiz endpoints sit under /api/brands/{brand}/quizzes/ with moduleAccess:quizzes middleware. Authenticate with EF-Access-Key.
List Quizzes
GET /api/brands/{brand}/quizzes
Results per page (1–100, default: 25)
newest, oldest, created_at, updated_at
curl https://app.elasticfunnels.io/api/brands/{brand_id}/quizzes \
-H "EF-Access-Key: your_api_key_here"
{
"current_page": 1,
"data": [
{
"id": 4,
"code": "health-quiz-xyz",
"name": "Health Assessment Quiz",
"page_id": 201,
"total_entries": 312,
"updated_at": "2024-12-10T15:00:00.000000Z"
}
],
"per_page": 25,
"total": 4,
"last_page": 1
}
List Quizzes (Unpaginated)
GET /api/brands/{brand}/quizzes/all
Returns { id, name, code } for all quizzes — useful for dropdowns and mapping.
Get Quiz
GET /api/brands/{brand}/quizzes/{quiz}
{
"id": 4,
"code": "health-quiz-xyz",
"name": "Health Assessment Quiz",
"page_id": 201,
"page": { "id": 201, "title": "Health Quiz Page", "slug": "health-quiz" },
"total_entries": 312,
"config": { /* quiz theme/layout config */ },
"fields": [
{ "id": 10, "code": "screen-abc", "name": "Question 1", "type": "single_choice", "order": 0 }
],
"slug": "health-quiz",
"domain": { "domain": "quiz.mybrand.com" }
}
flow_data is not included in the show response. Use GET .../flow to retrieve the flow graph.
Create Quiz
POST /api/brands/{brand}/quizzes
curl -X POST https://app.elasticfunnels.io/api/brands/{brand_id}/quizzes \
-H "EF-Access-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"name": "Health Assessment Quiz"}'
{
"quiz": {
"id": 4,
"code": "health-quiz-xyz",
"name": "Health Assessment Quiz",
"page_id": 201,
"total_entries": 0
}
}
Update Quiz
PUT /api/brands/{brand}/quizzes/{quiz}
ID of the page to associate with this quiz
Quiz display configuration (theme, layout, computed variables, etc.)
{
"id": 4,
"code": "health-quiz-xyz",
"name": "Health Assessment Quiz",
"config": { /* updated config */ }
}
Delete Quiz
DELETE /api/brands/{brand}/quizzes/{quiz}
Get Quiz Flow
Returns the visual flow graph (Drawflow format) and all screen definitions.
GET /api/brands/{brand}/quizzes/{quiz}/flow
curl https://app.elasticfunnels.io/api/brands/{brand_id}/quizzes/4/flow \
-H "EF-Access-Key: your_api_key_here"
{
"flow": {
"drawflow": {
"Home": {
"data": {
"1": { "id": 1, "name": "Question 1", "inputs": {}, "outputs": {} },
"2": { "id": 2, "name": "Result Screen", "inputs": {}, "outputs": {} }
}
}
}
},
"screens": [
{
"id": 10,
"code": "screen-abc",
"name": "Question 1",
"type": "single_choice",
"order": 0
}
]
}
If no flow has been saved yet, flow defaults to a minimal empty Drawflow structure ({"drawflow":{"Home":{"data":[]}}}).
Save Quiz Flow
POST /api/brands/{brand}/quizzes/{quiz}/flow
The complete Drawflow graph object. Can be null to clear the flow.
curl -X POST https://app.elasticfunnels.io/api/brands/{brand_id}/quizzes/4/flow \
-H "EF-Access-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"flow": { /* drawflow object */ }}'
{
"success": true,
"message": "Flow saved successfully"
}
Screens
Quiz screens are the individual question/result pages within a quiz. They are nested under the quiz resource.
List Screens
GET /api/brands/{brand}/quizzes/{quiz}/screens
{
"data": [
{
"id": 10,
"code": "screen-abc",
"name": "Do you experience bloating?",
"type": "single_choice",
"order": 0,
"options": [
{ "label": "Yes, often", "value": "often" },
{ "label": "Sometimes", "value": "sometimes" },
{ "label": "Never", "value": "never" }
],
"style": "light"
}
]
}
Get Screen
GET /api/brands/{brand}/quizzes/{quiz}/screens/{screen}
Create Screen
POST /api/brands/{brand}/quizzes/{quiz}/screens
Screen name / question title
Screen type: single_choice, multiple_choice, text_input, rating, result, info, video, image
Display title shown to the user
Subtitle or question description
Answer options (for choice screens) — each with label and value
Additional screen-level configuration
HTML content (for info and result screens)
Display order. Auto-incremented if omitted.
Audio file upload (multipart)
Image file upload (multipart)
curl -X POST https://app.elasticfunnels.io/api/brands/{brand_id}/quizzes/4/screens \
-H "EF-Access-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Bloating Question",
"type": "single_choice",
"title": "Do you experience bloating after meals?",
"style": "light",
"options": [
{"label": "Yes, often", "value": "often"},
{"label": "Sometimes", "value": "sometimes"},
{"label": "Never", "value": "never"}
]
}'
{
"quiz": {
"id": 10,
"code": "screen-abc",
"name": "Bloating Question",
"type": "single_choice",
"order": 3
}
}
Update Screen
PUT /api/brands/{brand}/quizzes/{quiz}/screens/{screen}
Same body as Create.
Delete Screen
DELETE /api/brands/{brand}/quizzes/{quiz}/screens/{screen}
Reorder Screens
POST /api/brands/{brand}/quizzes/{quiz}/screens/order
Map of { "<screenId>": <integer order>, ... }
curl -X POST https://app.elasticfunnels.io/api/brands/{brand_id}/quizzes/4/screens/order \
-H "EF-Access-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"order": {"10": 0, "11": 1, "12": 2}}'
Duplicate Screen
POST /api/brands/{brand}/quizzes/{quiz}/screens/{screen}/duplicate
Creates an exact copy of the screen with a new code and auto-assigned order.
Notes
flow_data is separate from the quiz’s config and screen definitions — save and retrieve it with the dedicated /flow endpoints
- Screen
code values are auto-generated unique identifiers used in the flow graph to connect questions to answer paths
total_entries tracks submission count and is incremented automatically when entries are submitted via the public form