---
title: "Update Site"
method: PUT
path: "/workspaces/{workspace_id}/site"
tags: ["Site"]
---

# Update Site

`PUT /workspaces/{workspace_id}/site`

Update the site for a workspace.

You can use head_code and footer_code parameters to inject custom code. Use head_code_mode and footer_code_mode to control whether code is appended or replaced.

## Path parameters

- `workspace_id` integer, required

## Query parameters

- `expand[]` string[]

## Request body

- object
  - `site` SiteParametersUpdate — Sites
    - `name` string — Name of the site.
    - `head_code` string, nullable — Custom code to inject into the site's <head> section. Content should be wrapped in appropriate HTML tags such as <script>, <link>, <meta>, or <style>. Set to null to clear existing code.
    - `head_code_mode` 'append' | 'replace' — How to handle head_code. 'append' adds to existing code (default), 'replace' overwrites.
    - `footer_code` string, nullable — Custom code to inject before the closing </body> tag. JavaScript should be wrapped in <script> tags. Set to null to clear existing code.
    - `footer_code_mode` 'append' | 'replace' — How to handle footer_code. 'append' adds to existing code (default), 'replace' overwrites.
    - `homepage_id` string — Set which page is served at the site's root path ("/"). Pass the page's public id, or an empty string to clear the homepage. Important: a page cannot become the homepage by setting its own path to "/" — this parameter is the only way to designate a page as the homepage. The theme_id, blog_theme_id, and store_theme_id fields are read-only in this endpoint; to change the default theme, use the theme set_default action.

## Response `200`

OK

- SiteAttributes — Sites represent a workspace's website configuration containing global code settings.
  - `id` integer — Site ID
  - `public_id` string — The public identifier of the site
  - `workspace_id` integer — Workspace ID that the site belongs to.
  - `name` string — Name of the site.
  - `created_at` string, date-time — Created at
  - `updated_at` string, date-time — Updated at
  - `head_code` string, nullable — **Expandable** Custom HTML/JavaScript code injected into the site head section. Only returned when expand[]=head_code is provided. Note: expanding may add latency, especially on list endpoints. Use sparingly.
  - `footer_code` string, nullable — **Expandable** Custom HTML/JavaScript code injected before the closing body tag. Only returned when expand[]=footer_code is provided. Note: expanding may add latency, especially on list endpoints. Use sparingly.
  - `homepage_id` string, nullable — The public id of the page served at the site's root path ("/"). Null when no homepage is configured.
  - `theme_id` string, nullable — Public id of the site's active theme.
  - `blog_theme_id` string, nullable — Public id of the site's blog theme.
  - `store_theme_id` string, nullable — Public id of the site's store theme.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `422` — Unprocessable Entity

---

[API](https://skmtc.net/myclickfunnels/apis/clickfunnels-api.md) · [All operations](https://skmtc.net/myclickfunnels/apis/clickfunnels-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/myclickfunnels/clickfunnels-api/revisions/ae6313eaa176/schema)
