> ## 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 contact form

> Learn how to create a contact form using the Tally API

## Prerequisites

* A Tally account
* An API key

## Request

To create the form, send a POST request to the `/forms` endpoint with the following payload:

```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": {
        "html": "Contact form"
      }
    },
    {
      "uuid": "48b4cdf3-2c9d-47d3-b8fb-b0ccabc5cd84",
      "type": "TITLE",
      "groupUuid": "93034250-5f05-4710-b8e0-5c9145c5b9ea",
      "groupType": "QUESTION",
      "payload": {
        "html": "Name"
      }
    },
    {
      "uuid": "884ff838-97f9-4ac9-8db1-31aa052df988",
      "type": "INPUT_TEXT",
      "groupUuid": "93034250-5f05-4710-b8e0-5c9145c5b9ea",
      "groupType": "QUESTION",
      "payload": {
        "isRequired": true,
        "placeholder": "Enter your name"
      }
    },
    {
      "uuid": "7d9c2e31-b5aa-4c8b-9c2d-123456789abc",
      "type": "TITLE",
      "groupUuid": "3287d15c-c2b2-4f84-a915-bc57380a4b51",
      "groupType": "QUESTION",
      "payload": {
        "html": "Email"
      }
    },
    {
      "uuid": "9b3f5d2a-1c8e-4f7d-b6a9-def012345678",
      "type": "INPUT_EMAIL",
      "groupUuid": "3287d15c-c2b2-4f84-a915-bc57380a4b51",
      "groupType": "QUESTION",
      "payload": {
        "isRequired": true,
        "placeholder": "Enter your email"
      }
    },
    {
      "uuid": "abc12345-6789-def0-1234-56789abcdef0",
      "type": "TITLE",
      "groupUuid": "456789ab-cdef-4321-b8e0-987654321def",
      "groupType": "QUESTION",
      "payload": {
        "html": "Message"
      }
    },
    {
      "uuid": "456789ab-cdef-0123-4567-89abcdef0123",
      "type": "TEXTAREA",
      "groupUuid": "456789ab-cdef-4321-b8e0-987654321def",
      "groupType": "QUESTION",
      "payload": {
        "isRequired": true,
        "placeholder": "Enter your message"
      }
    }
  ]
}'
```

This example adds in total 7 blocks to the form:

1. The form title
2. A title block for the name field
3. A required text input block for the name field
4. A title block for the email field
5. A required email input block for the email field
6. A title block for the message field
7. A required large text input block for the message field

## Response

The API will respond with a 201 status code and with some form meta data:

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

The form that was created should now show up in the Tally dashboard & look like this.

<Frame>
  <img src="https://mintcdn.com/tally/dNtl8XLd2Tzd_ywC/images/documentation/creating-a-contact-form.jpg?fit=max&auto=format&n=dNtl8XLd2Tzd_ywC&q=85&s=40d045d8958113aad9d4692b7a54b7d7" alt="Create a contact form" width="1440" height="900" data-path="images/documentation/creating-a-contact-form.jpg" />
</Frame>
