Skip to main content
Quiz endpoints sit under /api/brands/{brand}/quizzes/ with moduleAccess:quizzes middleware. Authenticate with EF-Access-Key.

List Quizzes

GET /api/brands/{brand}/quizzes
per_page
number
Results per page (1–100, default: 25)
q
string
Search by name
sort
string
newest, oldest, created_at, updated_at
cURL
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
name
string
required
Quiz name
cURL
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}
name
string
required
Quiz name (max 255)
page_id
number
ID of the page to associate with this quiz
config
object
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}
{ "success": true }

Get Quiz Flow

Returns the visual flow graph (Drawflow format) and all screen definitions.
GET /api/brands/{brand}/quizzes/{quiz}/flow
cURL
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
flow
any
The complete Drawflow graph object. Can be null to clear the flow.
cURL
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
name
string
required
Screen name / question title
type
string
required
Screen type: single_choice, multiple_choice, text_input, rating, result, info, video, image
title
string
Display title shown to the user
subtitle
string
Subtitle or question description
options
array
Answer options (for choice screens) — each with label and value
screen_settings
object
Additional screen-level configuration
content
string
HTML content (for info and result screens)
style
string
light or dark
order
number
Display order. Auto-incremented if omitted.
audio_file
file
Audio file upload (multipart)
image_preview_file
file
Image file upload (multipart)
cURL
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}
{ "success": true }

Reorder Screens

POST /api/brands/{brand}/quizzes/{quiz}/screens/order
order
object
required
Map of { "<screenId>": <integer order>, ... }
cURL
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}}'
{ "success": true }

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.
{ "success": true }

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