Skip to content

Skill: Update Site

The Update Site skill is a dual-mode skill that either fetches the current source code of an existing site or uploads new HTML, CSS, and JS files to replace the current content. The mode parameter determines which operation is performed.

This two-step pattern is intentional: agents first fetch the current source to understand the existing site, then push updates with the user’s requested changes applied.

ParameterTypeRequiredDescription
site_idstringYesThe unique identifier of the site to fetch or update. Obtained from Create Site or List Sites.
modestringYesThe operation mode: "fetch" to retrieve current source code, or "update" to upload new files.

These parameters are used only when mode is "update".

ParameterTypeRequiredDescription
htmlstringNoUpdated HTML content for index.html. If omitted, the existing HTML file is left unchanged.
cssstringNoUpdated CSS content for styles.css. If omitted, the existing CSS file is left unchanged.
jsstringNoUpdated JavaScript content for script.js. If omitted, the existing JS file is left unchanged.

A user might say:

“I want to change the color scheme on my Bean & Brew site. Can you pull up the current code?”

The agent invokes the skill in fetch mode:

  • site_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
  • mode: "fetch"

The skill returns the current HTML, CSS, and JS source code, which the agent uses as a starting point for edits.

After reviewing the source and applying the user’s requested changes, the agent invokes the skill again:

“Change the primary color to deep teal and update the hero heading to say ‘Welcome to Bean & Brew’.”

  • site_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
  • mode: "update"
  • html: (updated HTML with new heading)
  • css: (updated CSS with deep teal color palette)

The JS file is not passed, so it remains unchanged.

Returns the current source code of the site:

{
"site_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Bean & Brew Landing Page",
"html": "<!DOCTYPE html>...",
"css": "body { ... }",
"js": "document.addEventListener(...)"
}

Returns confirmation of the update with the new file metadata:

{
"site_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"url": "https://sites.horizon.app/a1b2c3d4/index.html",
"updated_files": ["html", "css"],
"updated_at": "2026-03-18T15:45:00Z"
}
  • Ownership enforcement — only the user who created the site (or their agents) can fetch or update it. Attempting to access another user’s site returns a 403 Forbidden error.
  • Atomic updates — when multiple files are updated in a single call, all files are written atomically. If any file fails validation, none of the files are updated.
  • File size limits — the same 1 MB per-file limit from Create Site applies to updates.
  • No partial HTML — when providing the html parameter, the content must be a complete HTML document, not a fragment.
  • Cache invalidation — updated files are available at the same URL immediately after a successful update. Horizon invalidates the storage cache on write.

POST /api/web/v1.0/update-site

See the Skill Execution API for details on authentication and request format.


Related skills: Create Site | List Sites | Retrieve Site