Întrebări
Adaugă, înlocuiește, editează și șterge întrebările unui formular.
- Adaugă întrebări la o poziție sau înlocuiește toată lista (elementele cu id sunt păstrate și actualizate, celelalte sunt create).
- O întrebare care are deja răspunsuri nu e ștearsă niciodată: primești 409 question_has_answers.
- Logica condițională se referă la întrebări prin id-urile publice qst_ și cere un plan cu logică condițională.
- GET /forms/{id} întoarce deja întrebările; agenții MCP folosesc get_questionnaire pentru asta.
get/forms/{form_id}/questions
List the questions of a form listQuestions
Scope: forms:read · Plan: Free și peste · Unealtă MCP: nu e expusă prin MCP
In display order. Not paginated (a form has at most 300 questions).
Parametri
| Nume | Unde | Tip | Obligatoriu | Descriere |
|---|---|---|---|---|
form_id | path | form_… id | da |
curl https://mform.md/api/public/v1/forms/form_8Hq2LmZ71cX/questions \
-H "Authorization: Bearer $MFORM_API_KEY"Răspuns 200
{
"object": "list",
"data": [
{
"id": "qst_2Jd8Kx0pQa9",
"object": "question",
"form_id": "form_8Hq2LmZ71cX",
"position": 1,
"section": "example",
"text": "How was your visit?",
"hint": "example",
"type": "short_text",
"required": false,
"options": [
"example"
],
"score_points": 1,
"logic": {},
"validation": {},
"payment": {
"amount_cents": 1,
"currency": "example",
"label": "example"
},
"allow_other": false,
"other_label": "example",
"has_answers": false,
"created_at": "2026-11-27T10:15:00Z"
}
]
}post/forms/{form_id}/questions
Add questions to a form addQuestions
Scope: forms:write · Plan: Pro și peste · Unealtă MCP: add_questions · acceptă Idempotency-Key
questions[].logic cere funcția conditionalLogic (Pro și peste)
Appends 1–100 questions (or inserts them at `position`). Returns all questions of the form.
Parametri
| Nume | Unde | Tip | Obligatoriu | Descriere |
|---|---|---|---|---|
form_id | path | form_… id | da | |
Idempotency-Key | header | string | nu | Any unique string (a UUID). The first result is kept 24 hours and replayed for the same key and body (`Idempotent-Replayed: true`); a different body returns `409 idempotency_key_reused`. |
Corp (JSON)
| Nume | Tip | Obligatoriu | Descriere |
|---|---|---|---|
questions | object[] | da | |
position | integer | nu | Insert before this 0-based position. Default = at the end. |
expected_updated_at | string (date-time) | nu | The form's `updated_at` you last read. If the form changed since, the call fails with `409 edit_conflict`. |
curl -X POST https://mform.md/api/public/v1/forms/form_8Hq2LmZ71cX/questions \
-H "Authorization: Bearer $MFORM_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"questions":[{"text":"How was your visit?","type":"short_text"}]}'Răspuns 201
{
"object": "list",
"data": [
{
"id": "qst_2Jd8Kx0pQa9",
"object": "question",
"form_id": "form_8Hq2LmZ71cX",
"position": 1,
"section": "example",
"text": "How was your visit?",
"hint": "example",
"type": "short_text",
"required": false,
"options": [
"example"
],
"score_points": 1,
"logic": {},
"validation": {},
"payment": {
"amount_cents": 1,
"currency": "example",
"label": "example"
},
"allow_other": false,
"other_label": "example",
"has_answers": false,
"created_at": "2026-11-27T10:15:00Z"
}
],
"form_updated_at": "2026-11-27T10:15:00Z"
}put/forms/{form_id}/questions
Replace the question list replaceQuestions
Scope: forms:write · Plan: Pro și peste · Unealtă MCP: update_questions
questions[].logic cere funcția conditionalLogic (Pro și peste)
Sets the full ordered list. Items with `id` are updated, items without `id` are created, existing questions missing from the list are removed. A question that already has answers is never removed: the call fails with `409 question_has_answers` (unpublish or keep it). `expected_updated_at` is required.
Parametri
| Nume | Unde | Tip | Obligatoriu | Descriere |
|---|---|---|---|---|
form_id | path | form_… id | da |
Corp (JSON)
| Nume | Tip | Obligatoriu | Descriere |
|---|---|---|---|
questions | object[] | da | |
expected_updated_at | string (date-time) | da | The form's `updated_at` you last read. If the form changed since, the call fails with `409 edit_conflict`. |
curl -X PUT https://mform.md/api/public/v1/forms/form_8Hq2LmZ71cX/questions \
-H "Authorization: Bearer $MFORM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"questions":[{"text":"How was your visit?","type":"short_text"}],"expected_updated_at":"2026-11-27T10:15:00Z"}'Răspuns 200
{
"object": "list",
"data": [
{
"id": "qst_2Jd8Kx0pQa9",
"object": "question",
"form_id": "form_8Hq2LmZ71cX",
"position": 1,
"section": "example",
"text": "How was your visit?",
"hint": "example",
"type": "short_text",
"required": false,
"options": [
"example"
],
"score_points": 1,
"logic": {},
"validation": {},
"payment": {
"amount_cents": 1,
"currency": "example",
"label": "example"
},
"allow_other": false,
"other_label": "example",
"has_answers": false,
"created_at": "2026-11-27T10:15:00Z"
}
],
"form_updated_at": "2026-11-27T10:15:00Z"
}get/questions/{question_id}
Retrieve a question getQuestion
Scope: forms:read · Plan: Free și peste · Unealtă MCP: nu e expusă prin MCP
Parametri
| Nume | Unde | Tip | Obligatoriu | Descriere |
|---|---|---|---|---|
question_id | path | qst_… id | da |
curl https://mform.md/api/public/v1/questions/qst_2Jd8Kx0pQa9 \
-H "Authorization: Bearer $MFORM_API_KEY"Răspuns 200
{
"id": "qst_2Jd8Kx0pQa9",
"object": "question",
"form_id": "form_8Hq2LmZ71cX",
"position": 1,
"section": "example",
"text": "How was your visit?",
"hint": "example",
"type": "short_text",
"required": false,
"options": [
"example"
],
"score_points": 1,
"logic": {},
"validation": {},
"payment": {
"amount_cents": 1,
"currency": "example",
"label": "example"
},
"allow_other": false,
"other_label": "example",
"has_answers": false,
"created_at": "2026-11-27T10:15:00Z"
}patch/questions/{question_id}
Update a question updateQuestion
Scope: forms:write · Plan: Pro și peste · Unealtă MCP: update_question
logic cere funcția conditionalLogic (Pro și peste)
Parametri
| Nume | Unde | Tip | Obligatoriu | Descriere |
|---|---|---|---|---|
question_id | path | qst_… id | da |
Corp (JSON)
| Nume | Tip | Obligatoriu | Descriere |
|---|---|---|---|
text | string | nu | |
hint | string | null | nu | |
section | string | null | nu | |
required | boolean | nu | |
options | string[] | null | nu | |
score_points | integer | null | nu | |
logic | object | null | nu | |
validation | object | null | nu | |
allow_other | boolean | nu | |
other_label | string | null | nu | |
position | integer | nu | |
expected_updated_at | string (date-time) | nu | The form's `updated_at` you last read. If the form changed since, the call fails with `409 edit_conflict`. |
curl -X PATCH https://mform.md/api/public/v1/questions/qst_2Jd8Kx0pQa9 \
-H "Authorization: Bearer $MFORM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"How was your visit?"}'Răspuns 200
{
"id": "qst_2Jd8Kx0pQa9",
"object": "question",
"form_id": "form_8Hq2LmZ71cX",
"position": 1,
"section": "example",
"text": "How was your visit?",
"hint": "example",
"type": "short_text",
"required": false,
"options": [
"example"
],
"score_points": 1,
"logic": {},
"validation": {},
"payment": {
"amount_cents": 1,
"currency": "example",
"label": "example"
},
"allow_other": false,
"other_label": "example",
"has_answers": false,
"created_at": "2026-11-27T10:15:00Z"
}delete/questions/{question_id}
Delete a question without answers deleteQuestion
Scope: forms:write · Plan: Pro și peste · Unealtă MCP: delete_question
A question that already has answers cannot be deleted (`409 question_has_answers`).
Parametri
| Nume | Unde | Tip | Obligatoriu | Descriere |
|---|---|---|---|---|
question_id | path | qst_… id | da |
curl -X DELETE https://mform.md/api/public/v1/questions/qst_2Jd8Kx0pQa9 \
-H "Authorization: Bearer $MFORM_API_KEY"Răspuns 200
{
"id": "example",
"object": "example",
"deleted": true
}