# /forms/{formId}/theme

Assign a theme to a specific form in the current account

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Formstack API v2025.0",
    "version": "0.0.4"
  },
  "servers": [
    {
      "url": "https://www.formstack.com/api/v2025",
      "description": "Production server"
    },
    {
      "url": "https://staging-formstack.com/api/v2025",
      "description": "Staging server"
    },
    {
      "url": "https://dev-formstack.com/api/v2025",
      "description": "Development server"
    }
  ],
  "paths": {
    "/forms/{formId}/theme": {
      "put": {
        "tags": [
          "Themes"
        ],
        "description": "Assign a theme to a specific form in the current account",
        "operationId": "assignThemeToForm",
        "parameters": [
          {
            "name": "formId",
            "in": "path",
            "description": "Unique identifier of the form",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "description": "Theme assignment data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignThemeToFormApiDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Theme assigned successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormThemeAssignDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid theme or form"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - No permission to modify form or use theme"
          },
          "404": {
            "description": "Form or theme not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "FormThemeAssignDto": {
        "title": "Form Theme Assignment Response",
        "description": "Response after successfully assigning a theme to a form",
        "properties": {
          "success": {
            "description": "Indicates if the theme assignment was successful",
            "type": "boolean",
            "nullable": false
          },
          "formId": {
            "description": "The ID of the form that received the theme",
            "type": "string",
            "nullable": false
          },
          "formName": {
            "description": "The name of the form that received the theme",
            "type": "string",
            "nullable": false
          },
          "currentThemeId": {
            "description": "The ID of the newly assigned theme",
            "type": "string",
            "nullable": false
          },
          "currentThemeName": {
            "description": "The name of the newly assigned theme",
            "type": "string",
            "nullable": false
          },
          "isCurrentThemeStock": {
            "description": "Indicates if the newly assigned theme is a stock theme",
            "type": "boolean",
            "nullable": false
          },
          "previousThemeId": {
            "description": "The ID of the theme that was previously assigned",
            "type": "string",
            "nullable": false
          },
          "previousThemeName": {
            "description": "The name of the theme that was previously assigned",
            "type": "string",
            "nullable": false
          },
          "isPreviousThemeStock": {
            "description": "Indicates if the previously assigned theme was a stock theme",
            "type": "boolean",
            "nullable": false
          }
        },
        "type": "object"
      },
      "AssignThemeToFormApiDto": {
        "title": "Assign Theme to Form Request",
        "description": "Request data for assigning a theme to a form",
        "properties": {
          "themeId": {
            "description": "The ID of the theme to assign to the form",
            "type": "string",
            "example": "light",
            "nullable": false
          }
        },
        "type": "object"
      }
    }
  },
  "tags": [
    {
      "name": "Themes",
      "description": "Themes control the visual styling applied to forms. Use these endpoints to list the themes in an account, copy a theme, delete a theme, list the forms using a theme, and assign a theme to a form. Deleting a theme switches its forms to the default theme."
    }
  ]
}
```