# Update Hosted Site Content by Slug

> Update Hosted Site Content by Slug is a paid API for AI agents from site.withzero.ai, paid per call via MPP, metered — billed by usage, status unknown (last checked 2026-10-01).

Replaces the HTML or Markdown content of an existing hosted site slug, re-running the rendering pipeline and optionally updating the title, format, or CSS.

## Facts

- Endpoint: PUT https://site.withzero.ai/sites/:slug?utm_source=zero.xyz
- Price: metered — billed by usage
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Provider: site.withzero.ai
- Website: https://site.withzero.ai
- Canonical page: https://www.zero.xyz/c/site-withzero-ai-update-hosted-site-content-by-slug-d4cbd0c7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bPqRnJfOgMUt8rkQcWThc

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability site-withzero-ai-update-hosted-site-content-by-slug-d4cbd0c7 -d '<json body>'
```

Example prompt: Update my hosted site at slug 'my-portfolio-2024' with this new markdown content: '# Updated Portfolio\nHere are my latest projects...' and change the title to 'My Portfolio 2024 — Updated'.

## When to prefer this

Use this endpoint when you need to update the content of an already-published site without changing its URL slug. Prefer this over deleting and recreating a site when you want to preserve the existing slug, URL, visit counter history, or custom domain mappings. Ideal for iterative content updates, editorial revisions, or programmatic content refreshes on a live page.

## Known failure modes

- Slug not found — returns 404 if the specified slug does not exist
- Unauthorized — returns 403 if the caller is not the owner of the slug
- Content too large — returns 400 if content exceeds 1MB limit
- Invalid format value — returns 400 if format is not 'html' or 'markdown'
- CSS too large — returns 400 if CSS exceeds 50,000 character limit
- Missing required content field — returns 400 if content is omitted

## How this service works

Replace the content of an existing slug. Owner-only. Re-runs the markdown → HTML / template-wrapping pipeline. Updates the visit counter's expiration. Title and format may be optionally updated; omitted fields preserve the existing value.

## Output

Returns an object confirming the update was applied to the slug, including the refreshed site metadata. The Markdown-to-HTML pipeline is re-run, the template wrapper is re-applied if applicable, and the visit counter expiration is reset.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "content"
 ],
 "properties": {
  "css": {
   "type": "string",
   "maxLength": 50000
  },
  "title": {
   "type": "string",
   "maxLength": 200,
   "minLength": 1
  },
  "format": {
   "enum": [
    "html",
    "markdown"
   ],
   "type": "string"
  },
  "content": {
   "type": "string",
   "maxLength": 1048576,
   "minLength": 1
  },
  "wrapInTemplate": {
   "type": "boolean"
  }
 },
 "additionalProperties": false
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/site-withzero-ai-update-hosted-site-content-by-slug-d4cbd0c7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from site.withzero.ai](https://www.zero.xyz/host/site.withzero.ai/llms.txt)
