# /subaccount/{subaccountId}/forms/{formId}/theme

Assign a theme to a specific form in the subaccount

# 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": {
    "/subaccount/{subaccountId}/forms/{formId}/theme": {
      "put": {
        "tags": [
          "Subaccounts"
        ],
        "description": "Assign a theme to a specific form in the subaccount",
        "operationId": "assignThemeToSubaccountForm",
        "parameters": [
          {
            "name": "subaccountId",
            "in": "path",
            "description": "Unique identifier of the subaccount",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "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/SubaccountAssignThemeToFormApiDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Theme assigned successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubaccountFormThemeAssignDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid theme or form"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - No permission to modify form or use theme"
          },
          "404": {
            "description": "Subaccount, form or theme not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SubaccountFormThemeAssignDto": {
        "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"
      },
      "SubaccountAssignThemeToFormApiDto": {
        "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": "Subaccounts",
      "description": "Subaccounts let a parent account manage separate child accounts. Use these endpoints to list subaccounts and to work with subaccount-scoped resources: copy a form into a subaccount, list a subaccount's themes, copy or delete a subaccount theme, list the forms using a subaccount theme, and assign a theme to a subaccount form. Subaccount records include details such as SMTP credentials."
    }
  ]
}
```