> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kodostatus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Custom Template

> Upload or replace the custom HTML template for a status page

<Info>
  Custom HTML templates require a **Pro** plan or higher.
</Info>

Upload a custom HTML template for your status page. Templates support template variables for dynamic data. The template is sanitized to block scripts, event handlers, and iframes.

## Path Parameters

<ParamField path="id" type="string" required>
  The status page ID
</ParamField>

## Request Body

Send the template as JSON or raw HTML.

<ParamField body="template" type="string" required>
  The HTML template content (max 64KB)
</ParamField>

## Response

<ResponseField name="template" type="string">
  The saved template content
</ResponseField>

<ResponseField name="updated_at" type="string">
  ISO 8601 timestamp
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT "https://kodostatus.com/api/v1/status-pages/550e8400-e29b-41d4-a716-446655440000/template" \
    -H "X-API-Key: your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "template": "<div class=\"status-header\">{{page.name}}</div><div class=\"services\">{{#each services}}...{{/each}}</div>"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "template": "<div class=\"status-header\">{{page.name}}</div>...",
    "updated_at": "2026-02-22T10:00:00.000Z"
  }
  ```
</ResponseExample>

## Errors

| Status | Error                                                | Description                                  |
| ------ | ---------------------------------------------------- | -------------------------------------------- |
| 400    | `Template content is required`                       | Empty or missing template                    |
| 400    | `Template exceeds maximum size of 64KB`              | Template is too large                        |
| 400    | `Template contains unsafe HTML`                      | Scripts, event handlers, or iframes detected |
| 403    | `Custom HTML templates require a Pro plan or higher` | Plan upgrade required                        |
