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

# Creating a dropdown

> Learn how to create a form with a dropdown using the Tally API

## Prerequisites

* A Tally account
* An API key

## Request

To create a form with a dropdown, you'll need to send a POST request with the form blocks, including the dropdown options. Each option is represented as a `DROPDOWN_OPTION` block.

```bash theme={null}
curl -X POST 'https://api.tally.so/forms' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
  "status": "PUBLISHED",
  "blocks": [
    {
      "uuid": "6ef8675d-33cb-419b-a81e-93982e726f2e",
      "type": "FORM_TITLE",
      "groupUuid": "073c835f-7ad4-459c-866d-4108b6b7e2e1",
      "groupType": "TEXT",
      "payload": {
        "title": "Dropdown example",
        "html": "Dropdown example"
      }
    },
    {
      "uuid": "2515b4dd-54e3-4502-afe6-074ad5019b44",
      "type": "TITLE",
      "groupUuid": "22a0af81-0117-4931-806f-2b83e374275b",
      "groupType": "QUESTION",
      "payload": {
        "html": "What'\''s your favorite color?"
      }
    },
    {
        "uuid": "338631d5-64b0-4a55-8219-17658e66196b",
        "type": "DROPDOWN_OPTION",
        "groupUuid": "aa64831b-8695-4887-afba-31c07034cd77",
        "groupType": "DROPDOWN",
        "payload": {
            "index": 0,
            "text": "Red"
        }
    },
    {
        "uuid": "4c8fe10a-b07e-407e-9347-f64d73a9ba9a",
        "type": "DROPDOWN_OPTION",
        "groupUuid": "aa64831b-8695-4887-afba-31c07034cd77",
        "groupType": "DROPDOWN",
        "payload": {
            "index": 1,
            "text": "Green"
        }
    },
    {
        "uuid": "3bddc101-571b-4f00-aa7a-30ee629441bc",
        "type": "DROPDOWN_OPTION",
        "groupUuid": "aa64831b-8695-4887-afba-31c07034cd77",
        "groupType": "DROPDOWN",
        "payload": {
            "index": 2,
            "text": "Blue"
        }
    }
  ]
}'
```

<Note>
  All dropdown options must share the same `groupUuid`. This groups them together as options for the
  same dropdown. The `index` field determines the order of the options.
</Note>

## Response

The API will respond with a 200 status code and return the newly created form:

```json theme={null}
{
  "id": "m2fK5R",
  "name": "Dropdown example",
  "workspaceId": "kb3o5R",
  "organizationId": "atL65s",
  "status": "PUBLISHED",
  "hasDraftBlocks": false,
  "isClosed": false,
  "updatedAt": "2024-12-20T10:34:19.262Z",
  "createdAt": "2024-12-20T10:34:19.262Z"
}
```

Your form will now be created with a dropdown containing the three color options.

<Frame>
  <img src="https://mintcdn.com/tally/dNtl8XLd2Tzd_ywC/images/documentation/creating-a-dropdown.jpg?fit=max&auto=format&n=dNtl8XLd2Tzd_ywC&q=85&s=b8749f7505aacc53a5fb4f800171e635" alt="Form with dropdown (builder view)" width="1440" height="900" data-path="images/documentation/creating-a-dropdown.jpg" />
</Frame>

<br />

<Frame>
  <img src="https://mintcdn.com/tally/dNtl8XLd2Tzd_ywC/images/documentation/creating-a-dropdown-2.jpg?fit=max&auto=format&n=dNtl8XLd2Tzd_ywC&q=85&s=74d34d14bf192e84f5e01e21ab690d84" alt="Form with dropdown (respondent view)" width="1440" height="900" data-path="images/documentation/creating-a-dropdown-2.jpg" />
</Frame>
