v1

latestOpenAPI 3.1.0MIT2026-07-243952451019.0 KB
Site

Update 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.

put/workspaces/{workspace_id}/site

Path parameters

workspace_idinteger required

Query parameters

expand[]string[]

Expand additional data in the response. Use expand[]=field_name to include optional fields (e.g., expand[]=head_code&expand[]=footer_code). See the Expanding guide for available fields and examples.

Request body

Example request

{
  "site": {
    "site": {
      "name": "My Updated Website",
      "head_code": "<script>console.log('site');</script>",
      "head_code_mode": "append",
      "homepage_id": "RcHPAt"
    }
  }
}

Response

OK

idinteger

Site ID

public_idstring

The public identifier of the site

workspace_idinteger

Workspace ID that the site belongs to.

namestring

Name of the site.

created_atstring date-time

Created at

updated_atstring date-time

Updated at

head_codestring 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_codestring 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_idstring nullable

The public id of the page served at the site's root path ("/"). Null when no homepage is configured.

theme_idstring nullable

Public id of the site's active theme.

blog_theme_idstring nullable

Public id of the site's blog theme.

store_theme_idstring nullable

Public id of the site's store theme.

Example response

{
  "id": 1,
  "public_id": "aBcDeF",
  "workspace_id": 42000,
  "name": "My Website",
  "created_at": "2025-01-01T00:00:00.000Z",
  "updated_at": "2025-01-01T00:00:00.000Z",
  "homepage_id": "RcHPAt",
  "theme_id": "dkGlMT",
  "blog_theme_id": null,
  "store_theme_id": null
}