> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.neetoform.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Questions

> List question kinds and add, change, copy, order and remove the questions of a form.

A question is one element of a form. The welcome screen, logo, banners and submit button count as elements too. For fields and response details, see the API reference for [question kinds](https://apidocs.neetoform.com/api/questions/kinds.md), [questions](https://apidocs.neetoform.com/api/questions/list.md) and [adding a question](https://apidocs.neetoform.com/api/questions/create.md).

Changes made with these commands are saved in the form's draft. Respondents do not see them until you run `neetoform forms publish <form-id>`. Reading a form with these commands shows the draft values.

## List question kinds

This command lists the kinds of question you can add. For each kind it shows the attributes and lists the kind accepts, with their types and limits. Use this before `questions create` to learn which attribute names are valid.

```bash theme={"system"}
neetoform question-kinds list --json
```

```json Sample output (--json) theme={"system"}
{
  "data": [
    {
      "kind": "multiple_choice",
      "is_singular": false,
      "attributes": [
        { "name": "label", "type": "string" },
        { "name": "image_height", "type": "integer", "minimum": 50, "maximum": 200 }
      ],
      "collections": [
        { "name": "options", "item_fields": ["label"] }
      ]
    }
  ]
}
```

A kind with `is_singular` set to `true`, such as `submit`, can appear only once in a form. Payment kinds are not listed because they cannot be added with the CLI.

## List questions

This command lists every element of a form in order, including the welcome screen, headings and the submit button. Use this when you want a question id.

```bash theme={"system"}
neetoform forms questions list 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 --json
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--page` | `int` | | `0` | Page number |
| `--page-size` | `int` | | `0` | Items per page (max 100) |

```json Sample output (--json) theme={"system"}
{
  "data": [
    {
      "id": "6b1f2c1e-2d7a-4a55-9c4e-0f1f8a7b2c11",
      "kind": "email",
      "position": 1,
      "state": "draft",
      "has_draft_changes": true,
      "attributes": {
        "label": "Work email",
        "is_required": true,
        "placeholder": ""
      }
    }
  ],
  "breadcrumbs": [
    {
      "label": "Show",
      "command": "neetoform forms questions show <form-id> <question-id>"
    },
    {
      "label": "Kinds",
      "command": "neetoform question-kinds list"
    }
  ],
  "pagination": {
    "current_page_number": 1,
    "total_pages": 1,
    "total_records": 1,
    "page_size": 30
  }
}
```

`state` is `draft` until the form is published with this question, then `published`. `has_draft_changes` tells you the question has changes that are not published yet.

## Show a question

This command shows one question with its current values, including changes that are not published yet.

```bash theme={"system"}
neetoform forms questions show 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 6b1f2c1e-2d7a-4a55-9c4e-0f1f8a7b2c11 --json
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`
* `<question-id>` - The question's UUID, from `neetoform forms questions list`

## Create a question

This command adds one question to a form. Use this when you need a single new question. To add many at once, use `bulk-create`.

```bash theme={"system"}
neetoform forms questions create 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 \
  --kind short_text \
  --label "Your name" \
  --required
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--description` | `string` | | | Question description |
| `--json-file` | `string` | | | Path to a JSON file with the question attributes, e.g. \{"label": "Work email", "is\_required": true, "options": \[\{"label": "Basic"}]}. Run "neetoform question-kinds list" for the attributes of each kind |
| `--kind` | `string` | Yes | | Question kind, e.g. short\_text or dropdown |
| `--label` | `string` | | | Question label |
| `--placeholder` | `string` | | | Input placeholder |
| `--position` | `int` | | `0` | Zero-based position; defaults to just before the submit button |
| `--required` | `bool` | | `false` | Whether an answer is required |

`--kind` is required. Without `--position`, the question is added just before the submit button.

`--label`, `--description`, `--placeholder` and `--required` are shortcuts for the attributes of the same name. `--json-file` holds the attributes of the question as one JSON object. Use it for anything the shortcuts do not cover, such as the options of a dropdown. A flag overrides the same key in the file.

```json theme={"system"}
{
  "label": "Plan",
  "is_required": true,
  "options": [{ "label": "Basic" }, { "label": "Pro" }]
}
```

```bash theme={"system"}
neetoform forms questions create 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 \
  --kind dropdown \
  --json-file plan.json
```

An attribute name that the kind does not accept is rejected. Run `neetoform question-kinds list` to see the valid names. The change stays in the draft until you publish.

## Create several questions

This command adds several questions in one call. Use this to build a form quickly.

```bash theme={"system"}
neetoform forms questions bulk-create 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 --json-file questions.json
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--json-file` | `string` | Yes | | Path to a JSON file, e.g. \{"questions": \[\{"kind": "phone"}, \{"kind": "yes\_no", "attributes": \{"label": "Subscribe?"}}]} |

`--json-file` is required. The file holds a `questions` list. Each item has a `kind` and, if needed, `attributes` and `position`.

```json theme={"system"}
{
  "questions": [
    { "kind": "phone" },
    { "kind": "yes_no", "attributes": { "label": "Subscribe?" } }
  ]
}
```

The call is all or nothing. If one question is rejected, no question is added.

## Update a question

This command changes the values of a question. Use this to rename a question, make it required or change its options. It also works for the welcome screen, logo, banner, submit button and progress bar. You cannot change the kind of a question.

```bash theme={"system"}
neetoform forms questions update 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 6b1f2c1e-2d7a-4a55-9c4e-0f1f8a7b2c11 \
  --label "Work email address" \
  --required
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`
* `<question-id>` - The question's UUID, from `neetoform forms questions list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--description` | `string` | | | Question description |
| `--json-file` | `string` | | | Path to a JSON file with the question attributes, e.g. \{"label": "Work email", "is\_required": true, "options": \[\{"label": "Basic"}]}. Run "neetoform question-kinds list" for the attributes of each kind |
| `--label` | `string` | | | Question label |
| `--placeholder` | `string` | | | Input placeholder |
| `--required` | `bool` | | `false` | Whether an answer is required |

`--json-file` works as it does on `create`: one JSON object of attributes, with flags overriding the same keys. A list such as `options` replaces the whole list, so send every option you want to keep. The change stays in the draft until you publish.

## Delete a question

This command removes a question from the form's draft.

```bash theme={"system"}
neetoform forms questions delete 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 6b1f2c1e-2d7a-4a55-9c4e-0f1f8a7b2c11
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`
* `<question-id>` - The question's UUID, from `neetoform forms questions list`

```text Sample output theme={"system"}
Question deleted.
```

Some elements cannot be deleted, and the command prints the reason when that happens.

## Clone a question

This command copies a question, including changes that are not published yet. The copy is placed right after the original.

```bash theme={"system"}
neetoform forms questions clone 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 6b1f2c1e-2d7a-4a55-9c4e-0f1f8a7b2c11
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`
* `<question-id>` - The question's UUID, from `neetoform forms questions list`

A kind that is allowed only once in a form, such as the submit button, cannot be cloned.

## Reorder questions

This command sets the order of all elements of a form. Use this to move questions around.

```bash theme={"system"}
neetoform forms questions reorder 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 \
  --ids 1f0c...,6b1f...,9a3f...
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--ids` | `string` | Yes | | Comma-separated ids of every element of the form in the new order, logo, welcome screen and submit button included |

`--ids` must name every element of the form exactly once, including the logo, welcome screen and submit button. Keep the logo first. Take the ids from `neetoform forms questions list`. If the list is incomplete or has a repeat, the order is not applied.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.