Skill: Update Site
Dual-mode skill for fetching a site's current source code or uploading updated HTML, CSS, and JavaScript files.
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.
Parameters
Common parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
site_id | string | Yes | The unique identifier of the site to fetch or update. Obtained from Create Site or List Sites. |
mode | string | Yes | The operation mode: "fetch" to retrieve current source code, or "update" to upload new files. |
Update mode parameters
These parameters are used only when mode is "update".
| Parameter | Type | Required | Description |
|---|---|---|---|
html | string | No | Updated HTML content for index.html. If omitted, the existing HTML file is left unchanged. |
css | string | No | Updated CSS content for styles.css. If omitted, the existing CSS file is left unchanged. |
js | string | No | Updated JavaScript content for script.js. If omitted, the existing JS file is left unchanged. |
You do not need to provide all three file parameters when updating. If you only need to change the CSS, pass just css along with site_id and mode: "update". The HTML and JS files will remain as they are.
Example usage
Fetching current source code
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-ef1234567890mode:"fetch"
The skill returns the current HTML, CSS, and JS source code, which the agent uses as a starting point for edits.
Pushing updates
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-ef1234567890mode:"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.
Response structure
Fetch mode response
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(...)"
}Update mode response
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"
}Behavior notes
- 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 Forbiddenerror. - 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
htmlparameter, 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.
The update operation replaces the entire file contents. There is no patch or diff mechanism. Agents should always fetch the current source code first to avoid accidentally discarding existing content.
Related skills: Create Site | List Sites | Retrieve Site