# /subaccount/{subaccountId}/themes/{themeId}

Delete a theme from the specified subaccount. Forms using this theme will be switched to the default theme.

# 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}/themes/{themeId}": {
      "delete": {
        "tags": [
          "Subaccounts"
        ],
        "description": "Delete a theme from the specified subaccount. Forms using this theme will be switched to the default theme.",
        "operationId": "deleteSubaccountTheme",
        "parameters": [
          {
            "name": "subaccountId",
            "in": "path",
            "description": "Unique identifier of the subaccount",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "themeId",
            "in": "path",
            "description": "Unique identifier of the theme to delete",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Theme deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeDeleteDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Theme cannot be deleted"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Subaccount or theme not found"
          },
          "409": {
            "description": "Conflict - Theme is in use and cannot be deleted"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ThemeDeleteDto": {
        "title": "Theme Delete Response",
        "description": "Response after successfully deleting a theme",
        "properties": {
          "deleted": {
            "description": "Indicates if the theme was successfully deleted",
            "type": "boolean",
            "nullable": false
          },
          "themeId": {
            "description": "The ID of the deleted theme",
            "type": "string",
            "nullable": false
          },
          "themeName": {
            "description": "The name of the deleted theme",
            "type": "string",
            "nullable": false
          },
          "formsAffected": {
            "description": "Number of forms that were using this theme",
            "type": "integer",
            "nullable": false
          },
          "fallbackThemeId": {
            "description": "The ID of the theme that forms were switched to",
            "type": "string",
            "nullable": false
          },
          "fallbackThemeName": {
            "description": "The name of the theme that forms were switched to",
            "type": "string",
            "nullable": false
          },
          "isStockFallback": {
            "description": "Indicates if the fallback theme is a stock theme",
            "type": "boolean",
            "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."
    }
  ]
}
```