Skip to content

Update a Quiz

Update the properties of an existing quiz including name, appearance, scheduling, and content settings.


Overview

This endpoint allows you to modify various properties of an existing quiz. Note that for quizzes that have already started, only certain fields can be updated.

Method: PATCH
Endpoint:
/api/v1/namespaces/{namespaceId}/quizzes/{quizId}

Requires administrator authentication.


Request

Headers

http
x-api-key: {your_api_key}  # Required
Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
namespaceIdstringNamespace unique ID
quizIdstringQuiz unique ID

Body Parameters

ParameterTypeRequiredDescription
namestringName of the quiz
startdateTimestamp in milliseconds when the quiz becomes active
enddateTimestamp in milliseconds when the quiz closes, must be greater than start time
primaryColorstringHex color code for the quiz theme (#RRGGBB or #RGB format)
retryAfterDaysintegerNumber of days to wait before retry, must be 0 (for no retry) or greater
anonymousbooleanIndicates if the quiz allows anonymous responses
disableEmailingbooleanPrevents the quiz from sending emails
customIntroScreenobjectCustom introduction screen configuration
customOutroScreenobjectCustom conclusion screen configuration
customLogostring/objectCustom logo URL or object
demographicMessagestringCustom message for demographic section
hasCustomIntrobooleanIndicates if quiz uses custom intro screen
hasCustomOutrobooleanIndicates if quiz uses custom outro screen
customCTAobjectCustom call-to-action configuration
fhscorebooleanEnable financial health scoring
customRecommendationCardobjectCustom recommendation card configuration

customIntroScreen Object

FieldTypeRequiredDescription
headerMessagestringHeader text for intro screen. Can be empty
mainMessagestringMain body text for intro screen. Can be empty
buttonMessagestringCustom text for start button. Can be empty
footnoteMessagestringFooter text for intro screen. Can be empty
customLogoUrlstringURL for custom logo on intro screen
inheritLogobooleanWhether to inherit logo from namespace

customOutroScreen Object

FieldTypeRequiredDescription
outroMessagestringMessage displayed on completion screen if hasCustomOutro is true

customCTA Object

FieldTypeRequiredDescription
ctaLinkstringURL for call-to-action. Can be empty
ctaTitlestringTitle for call-to-action (max 65 chars)
ctaButtonstringButton text for CTA (max 50 chars)
ctaDescriptionstringDescription text for CTA (max 320 chars)
stickybooleanWhether CTA should be sticky

customRecommendationCard Object

This is where the recommendations live, and they can be customized. Each key in this object represents a card ID. The keys must be the following:

  • fhn1
  • fhn2
  • fhn3
  • fhn4
  • fhn5
  • fhn6
  • fhn7
  • fhn8

Empty text fields will have a default set value, except for the CTA links. The customRecommendationCard object has the following properties:

FieldTypeRequiredDescription
titlestringCard title. Can be empty
subtitlestringCard subtitle. Can be empty
recommendationTitlestringTitle for recommendations. Can be empty
recommendationsarrayArray of recommendation strings
CTA1ButtonstringText for first CTA button. Can be empty
CTA1LinkstringURL for first CTA. Can be empty
CTA2ButtonstringText for second CTA button. Can be empty
CTA2LinkstringURL for second CTA. Can be empty
CTA3ButtonstringText for third CTA button. Can be empty
CTA3LinkstringURL for third CTA. Can be empty

Example Request Body

json
{
  "name": "Updated Quiz Name",
  "primaryColor": "#6633ff",
  "end": 1626607199999,
  "customLogo": "https://example.com/logo.png",
  "hasCustomIntro": true,
  "customIntroScreen": {
    "headerMessage": "Welcome to Our Survey",
    "mainMessage": "Help us improve your experience",
    "buttonMessage": "Begin Survey"
  },
  "customCTA": {
    "ctaLink": "https://example.com/learn-more",
    "ctaTitle": "Learn More About Financial Health",
    "ctaButton": "Explore Resources",
    "ctaDescription": "Discover tools and tips to improve your financial well-being"
  }
}

Response

Success Response

json
{
  "quiz": {
    "id": "hK5ZY9n6xaUF5Mu3hnwV",
    "name": "Updated Quiz Name",
    "primaryColor": "#6633ff",
    "customCTA": {
      "ctaLink": "https://example.com/learn-more",
      "ctaTitle": "Learn More About Financial Health",
      "ctaButton": "Explore Resources",
      "ctaDescription": "Discover tools and tips to improve your financial well-being"
    },
    "customCTAs": {},
    "customRecommendationCard": {},
    "customIntroScreen": {
      "headerMessage": "Welcome to Our Survey",
      "mainMessage": "Help us improve your experience",
      "buttonMessage": "Begin Survey",
      "customLogoUrl": "https://storage.googleapis.com/fhc-dev-files/https://example.com/logo.png"
    },
    "hasCustomIntro": true,
    "customOutroScreen": {},
    "createdOn": 1752737950897,
    "start": 1758637199999,
    "end": 1759637199999,
    "questions": [
      {
        "id": "fhn1",
        "order": 1,
        "text": "In the last 12 months, my household <strong>spent</strong>...",
        "type": "multipleChoice",
        "required": true,
        "answers": [
          {
            "id": "4b7e6d70-fd93-494a-874d-ea783f825289",
            "code": 1,
            "text": "Much less than our income",
            "score": 100
          },
          /* Additional answers omitted for brevity */
        ],
        "help": "Your income is all the money you've made, after taxes. Compare that to how much you spent.",
        "visible": true,
        "category": "finhealth"
      },
      /* Additional questions omitted for brevity */
    ],
    "anonymous": true,
    "inapp": false,
    "fhscore": false,
    "status": "queued",
    "disableEmailing": true,
    "emailedOn": null,
    "wasReminded": false,
    "lastDfUpdate": {
      "_seconds": 1752737950,
      "_nanoseconds": 897000000
    }
  }
}

Notes

  • For quizzes that have already started, only the following fields can be updated:
    • name
    • start
    • end
    • fhscore
    • customCTAs
    • customCTA
    • customIntroScreen
    • customOutroScreen
    • resultScreen
    • customLogo
    • hasCustomIntro
    • hasCustomOutro
    • customRecommendationCard
  • Attempting to update other fields on an active quiz will result in those changes being ignored.
  • You can update one or more properties in a single request.