Вопросы
Добавление, замена, правка и удаление вопросов формы.
- Добавляйте вопросы в позицию или заменяйте весь список (элементы с id сохраняются и обновляются, остальные создаются).
- Вопрос, на который уже есть ответы, никогда не удаляется: вы получите 409 question_has_answers.
- Условная логика ссылается на вопросы по публичным id qst_ и требует тариф с условной логикой.
- GET /forms/{id} уже возвращает вопросы; MCP-агенты используют для этого get_questionnaire.
get/forms/{form_id}/questions
List the questions of a form listQuestions
Scope: forms:read · Тариф: Free и выше · Инструмент MCP: не доступна через MCP
In display order. Not paginated (a form has at most 300 questions).
Параметры
| Имя | Где | Тип | Обязательный | Описание |
|---|---|---|---|---|
form_id | path | form_… id | да |
curl https://mform.md/api/public/v1/forms/form_8Hq2LmZ71cX/questions \
-H "Authorization: Bearer $MFORM_API_KEY"Ответ 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 · Тариф: Pro и выше · Инструмент MCP: add_questions · поддерживает Idempotency-Key
questions[].logic требует функцию conditionalLogic (Pro и выше)
Appends 1–100 questions (or inserts them at `position`). Returns all questions of the form.
Параметры
| Имя | Где | Тип | Обязательный | Описание |
|---|---|---|---|---|
form_id | path | form_… id | да | |
Idempotency-Key | header | string | нет | 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`. |
Тело (JSON)
| Имя | Тип | Обязательный | Описание |
|---|---|---|---|
questions | object[] | да | |
position | integer | нет | Insert before this 0-based position. Default = at the end. |
expected_updated_at | string (date-time) | нет | 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"}]}'Ответ 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 · Тариф: Pro и выше · Инструмент MCP: update_questions
questions[].logic требует функцию conditionalLogic (Pro и выше)
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.
Параметры
| Имя | Где | Тип | Обязательный | Описание |
|---|---|---|---|---|
form_id | path | form_… id | да |
Тело (JSON)
| Имя | Тип | Обязательный | Описание |
|---|---|---|---|
questions | object[] | да | |
expected_updated_at | string (date-time) | да | 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"}'Ответ 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 · Тариф: Free и выше · Инструмент MCP: не доступна через MCP
Параметры
| Имя | Где | Тип | Обязательный | Описание |
|---|---|---|---|---|
question_id | path | qst_… id | да |
curl https://mform.md/api/public/v1/questions/qst_2Jd8Kx0pQa9 \
-H "Authorization: Bearer $MFORM_API_KEY"Ответ 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 · Тариф: Pro и выше · Инструмент MCP: update_question
logic требует функцию conditionalLogic (Pro и выше)
Параметры
| Имя | Где | Тип | Обязательный | Описание |
|---|---|---|---|---|
question_id | path | qst_… id | да |
Тело (JSON)
| Имя | Тип | Обязательный | Описание |
|---|---|---|---|
text | string | нет | |
hint | string | null | нет | |
section | string | null | нет | |
required | boolean | нет | |
options | string[] | null | нет | |
score_points | integer | null | нет | |
logic | object | null | нет | |
validation | object | null | нет | |
allow_other | boolean | нет | |
other_label | string | null | нет | |
position | integer | нет | |
expected_updated_at | string (date-time) | нет | 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?"}'Ответ 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 · Тариф: Pro и выше · Инструмент MCP: delete_question
A question that already has answers cannot be deleted (`409 question_has_answers`).
Параметры
| Имя | Где | Тип | Обязательный | Описание |
|---|---|---|---|---|
question_id | path | qst_… id | да |
curl -X DELETE https://mform.md/api/public/v1/questions/qst_2Jd8Kx0pQa9 \
-H "Authorization: Bearer $MFORM_API_KEY"Ответ 200
{
"id": "example",
"object": "example",
"deleted": true
}