---
title: "Regenerate AI page"
method: PUT
path: "/links/page/{id}"
tags: ["Pages"]
---

# Regenerate AI page

`PUT /links/page/{id}`

## Request

- Base URL: `https://api.short.io`
- URL: `https://api.short.io/links/page/{id}`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/short/apis/short-io-api-2/docs/links/page/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

Generates a new HTML document from a new prompt and replaces the page with it. Responds with an `application/x-ndjson` stream, one JSON event per line: `start` (`maxOutputTokens`), `heartbeat` (`elapsedMs`, `outputChars`) at least every 10 seconds while the page is generated, then exactly one terminal event - `done` (`page`) or `error` (`code`, `status`, `message`). `code` is `prompt_rejected` (400), `generation_failed` (502), `generation_timeout` (504), `link_refused` (the status the link write was refused with) or `internal_error` (500). Refusals decided before generation starts are ordinary JSON replies with their status code.

## Path parameters

- `id` string, required

## Request body

- object
  - `prompt` string, required: What the page should be. The HTML is generated from it and cannot be edited directly

## Other responses

- `400`: Default Response
- `402`: Default Response
- `403`: Default Response
- `404`: Default Response
- `500`: Default Response
- `503`: Default Response

## Changes

> 9 revisions in range; 1 not diffed.

- **2026-11-03** `1152ff5ece4d`: 1 info
  - endpoint added
- **2026-11-03** `e787ffbc6947`: 1 breaking
  - api path removed without deprecation
- **2026-10-28** `e60645055120`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/short/apis/short-io-api-2/changes/links/page/:id/put.md)

---

[API](https://skmtc.dev/short/apis/short-io-api-2.md) - [All operations](https://skmtc.dev/short/apis/short-io-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/short/apis/short-io-api-2/revisions/75e8b589c8c5?raw)
