Перейти к основному содержанию

Запуск: −50% на 3 месяца с кодом LANSARE50

Цены →

Вопросы

Добавление, замена, правка и удаление вопросов формы.

  • Добавляйте вопросы в позицию или заменяйте весь список (элементы с 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_idpathform_… 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_idpathform_… idда
Idempotency-Keyheaderstringнет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)

ИмяТипОбязательныйОписание
questionsobject[]да
positionintegerнетInsert before this 0-based position. Default = at the end.
expected_updated_atstring (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_idpathform_… idда

Тело (JSON)

ИмяТипОбязательныйОписание
questionsobject[]да
expected_updated_atstring (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_idpathqst_… 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_idpathqst_… idда

Тело (JSON)

ИмяТипОбязательныйОписание
textstringнет
hintstring | nullнет
sectionstring | nullнет
requiredbooleanнет
optionsstring[] | nullнет
score_pointsinteger | nullнет
logicobject | nullнет
validationobject | nullнет
allow_otherbooleanнет
other_labelstring | nullнет
positionintegerнет
expected_updated_atstring (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_idpathqst_… 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
}