Skip to content

Question Library API

Endpoints for the question library (past question data).

Registration happens automatically, so there is no registration endpoint.

Registration path Corresponding API
Survey export Export JSON in the Surveys API
Import from CS Import a Creative Survey Bundle in the Imports API

Reuse is performed through Import a Question and Insert One Section from External Entries.

See API Definition for authentication, response format, and error handling.

Method

HTTP Methods

Method URI Overview
GET /api/question-library List past question data
DELETE /api/question-library/{itemId} Delete past question data

Resource Definition

Library Entry Schema

Field Type Notes
id string UUID
sourceSurveyId string | null Source survey UUID for internal-origin entries
sourceSurveyTitle string | null Title of the source survey
sourceQuestionId string | null Source question UUID for internal-origin entries
sourceSectionId string UUID of the source section
sourceExternalSurveyId string | null External questionnaire UUID for external-origin entries
sourceExternalSurveyName string | null Name of the external questionnaire
sourceExternalQuestionId string | null External question UUID for external-origin entries
category string Category. Used to filter searches
sectionTitle string Title of the original section
questionType enum single / multi / free_text / matrix / intro / pulldown
normalizedPayload object Normalized question content
createdAt string Registration timestamp (ISO 8601)
createdBy string | null User ID of the registrant

normalizedPayload

Field Type Notes
promptText string Prompt text
options object[] Choices (label / isExclusive / allowOtherInput / isNotApplicable)
subItems object[] Sub items (such as matrix columns). label only
subQuestions object[] Sub-questions (label + options)

Branching is not included

The normalized payload contains no branch rules or visibility logic. They must be configured again after reuse.

Authentication

User authentication via the x-user-email / x-user-name headers is required.

Any authenticated user may list entries. Deletion is limited to administrators; anyone else receives 403 Forbidden.

Not even the registrant can delete

createdBy records who registered the entry, but it has no effect on who may delete it. Unless you are an administrator (a user listed in SURVEY_ADMIN_EMAILS), you cannot delete even the entries you registered yourself.

List Past Question Data

Overview

Returns the list of past question data. It can be filtered by keyword and category.

URI

GET /api/question-library

Query Parameters

Parameter Type Required Notes
q string Keyword search over prompt text and section title
category string Filter by category

Response (200 OK)

{
  "ok": true,
  "data": [
    {
      "id": "โ€ฆ",
      "sourceSurveyId": "โ€ฆ",
      "sourceSurveyTitle": "ใƒ–ใƒฉใƒณใƒ‰่ช็Ÿฅๅบฆ่ชฟๆŸป",
      "sourceQuestionId": "โ€ฆ",
      "sourceSectionId": "โ€ฆ",
      "sourceExternalSurveyId": null,
      "sourceExternalSurveyName": null,
      "sourceExternalQuestionId": null,
      "category": "ใƒ–ใƒฉใƒณใƒ‰",
      "sectionTitle": "่ช็Ÿฅ",
      "questionType": "multi",
      "normalizedPayload": {
        "promptText": "ไปฅไธ‹ใฎใ†ใกใ€็Ÿฅใฃใฆใ„ใ‚‹ใƒ–ใƒฉใƒณใƒ‰ใ‚’ใ™ในใฆใŠ้ธใณใใ ใ•ใ„ใ€‚",
        "options": [
          { "label": "ใƒ–ใƒฉใƒณใƒ‰ A", "isExclusive": false, "allowOtherInput": false, "isNotApplicable": false }
        ]
      },
      "createdAt": "2026-08-10T00:00:00.000Z",
      "createdBy": "โ€ฆ"
    }
  ]
}

Error Handling

Description Status code Status name
Authentication headers missing 401 Unauthorized

Delete Past Question Data

Overview

Deletes a past question data entry. Only administrators may perform this.

URI

DELETE /api/question-library/{itemId}
Parameter Type Required Notes
itemId string โ—ฏ UUID of the library entry

Response (200 OK)

{ "ok": true, "data": { "deleted": true } }

Error Handling

Description Status code Status name
Not an administrator 403 Forbidden
The library entry does not exist 404 Not Found

Processing Flow

  1. Return 403 if the user is not an administrator (checked before the entry is looked up)
  2. Delete the entry
  3. Return 404 if nothing was deleted

Re-exporting replaces entries

Re-exporting a survey deletes its existing library entries and re-registers them from the current questions. Manually deleted entries reappear after a re-export.