Overview
The publishable-key API used by the Confetti widget.
The public API is what the Confetti widget (@opengovsg/confetti) uses to fetch
surveys, submit responses, and record respondent events. It is designed to be
called from the browser.
Most teams never call these endpoints directly. The
@opengovsg/confetti npm
package already calls them for you. Reach for this API only if you're building
a custom widget instead of using the package.
Looking for cool-downs such as “hide after a response” or “don’t show again
for X days after dismiss”? Those are configured on the widget with
isSurveyVisible, not as API query parameters. See
When to show the survey.
Authentication
Every request is authenticated with your team's publishable key, sent in the
x-cfti-pk header:
GET /api/v1/cfti/{surveyId} HTTP/1.1
Host: confetti.gov.sg
x-cfti-pk: <your-publishable-key>Find your publishable key on the Setup page in Confetti.
The publishable key is safe to expose in client-side code — it only grants access to published surveys on your authorised domains. For backend integrations, use the server-to-server API instead.
Endpoints
Browse the endpoints grouped by resource in the sidebar.
Was this page helpful?