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
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
| Parameter | Type | Required | Notes |
|---|---|---|---|
| itemId | string | โฏ | UUID of the library entry |
Response (200 OK)
Error Handling
| Description | Status code | Status name |
|---|---|---|
| Not an administrator | 403 | Forbidden |
| The library entry does not exist | 404 | Not Found |
Processing Flow
- Return 403 if the user is not an administrator (checked before the entry is looked up)
- Delete the entry
- 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.