Prerequisites

  • A Tally account
  • An API key
  • An existing form

Request

To style blocks, you can use basic HTML markup in the html field.

curl -X PATCH 'https://api.tally.so/forms/:id' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
  "name": "Test",
  "status": "PUBLISHED",
  "blocks": [
    {
      "uuid": "6ef8675d-33cb-419b-a81e-93982e726f2e",
      "type": "FORM_TITLE",
      "groupUuid": "073c835f-7ad4-459c-866d-4108b6b7e2e1",
      "groupType": "TEXT",
      "payload": {
        "html": "Test",
        "title": "Test"
      }
    },
    {
      "uuid": "48b4cdf3-2c9d-47d3-b8fb-b0ccabc5cd84",
      "type": "TITLE",
      "groupUuid": "93034250-5f05-4710-b8e0-5c9145c5b9ea",
      "groupType": "QUESTION",
      "payload": {
        "html": "What'\''s your <span style=\"color: #eb4d4b\"><i><b>name</b></i></span>?"
      }
    },
    {
      "uuid": "884ff838-97f9-4ac9-8db1-31aa052df988",
      "type": "INPUT_TEXT",
      "groupUuid": "3287d15c-c2b2-4f84-a915-bc57380a4b51",
      "groupType": "INPUT_TEXT",
      "payload": {
        "isRequired": true,
        "placeholder": ""
      }
    }
  ]
}'
In this example, we’ll be styling “name” in the question title block.

Response

The API will respond with a 200 status code and return the some meta data about the form:

{
  "id": "m2fK5R",
  "name": "Test",
  "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 display with a styled title block where “name” appears in italic, bold, and in red (#eb4d4b).