pagehive

read_page

Read one page from the draft.

Draft contentRead-onlyAll plansUpdated

What it does

Read one page from the draft. By default it returns source only: the template, page CSS, global CSS, the partials the template includes and the scripts it references, without rendered HTML or element ids. files limits that set (template, page_css, global_css, partials, scripts, partial:name, script:name); rendered true adds the rendered HTML and rendered_status, the HTTP status the page answers with (200, or the 404 or 410 it set with {% status %}); query renders it with URL values, such as { "d": "2026-11-20" } for path?d=2026-11-20 (it implies rendered); elements bot returns the ids the bot wrote, and elements all adds the automatic ph- ids. comments is open (default) or all; a site key gets none. Every response carries version, the current draft version, which patch_page accepts as base_version. One response holds at most 32000 characters of file text and is never cut off without a cursor: next holds the arguments for the following read (file, offset, version, plus rendered, query, files and elements when set) and is null at the end; elements_offset then continues until elements_next is null. A follow-up without the first read's rendered or files can fail with validation_failed reason unknown_file, and one after the draft changed fails with reason page_changed. outline, lines and rendered "check" are lighter reads. hash fingerprints the answer; with if_hash set to it and the same arguments, an unchanged read answers only { unchanged: true, hash }. Page and template reference: https://pagehive.io/docs/bot-guide.md (section Pages and partials).

Plans

Works on every plan: Free, Basic, Pro and Ultra.

Parameters

NameTypeAbout
site_idrequiredstringThe id of the site. list_sites gives the ids of your sites.
pathrequiredstringThe page to read, such as /.
commentsone of: open, allopen (default) returns open comment threads on the page; all also returns resolved ones.
filesstring or array of stringLimits the files returned: template, page_css, global_css, partials, scripts, or one by name such as partial:header.
renderedboolean or checktrue adds the rendered HTML. "check" renders the page and answers only render (ok or failed, with the error), rendered_status, rendered_chars and element_count: no HTML and no source.
outlinebooleantrue lists the page's files (template, page_css, global_css, partial:name, script:name) with chars and lines, and no text.
linesobjectLines from to to (1-based, inclusive; to left out reads to the end) of the file named in file: template, page_css, global_css, partial:name or script:name. Not with offset.
queryobjectURL values to render the page with, such as { "d": "2026-11-20" } for path?d=2026-11-20. Implies rendered.
elementsone of: none, bot, allbot returns the element ids your agent wrote; all also returns the automatic ones.
filestringThe file to continue reading, from next in an earlier response.
offsetintegerWhere to continue in that file, from next.
limitintegerThe most characters of file text to return.
elements_offsetintegerWhere to continue the element list, from elements_next.
versionintegerThe draft version from next. If the draft changed in between, the call fails with page_changed.
if_hashstringThe hash from an earlier answer of this tool with the same arguments. When the content is the same, the answer is only { unchanged: true, hash }.
draftstringOptional name of your own draft of this site (lowercase letters, digits and dashes, at most 40), such as "pricing-redesign". Each agent has its own drafts, so other agents' work never mixes into yours; give a name when you might work on this site from more than one chat at once, and use the same name on every read, write and publish of that piece of work. Without it you use your default draft.
cursorstringnext_cursor from the previous page of this tool, to read the next page. Send the other arguments as on the first call; leave out the paging arguments the cursor replaces.

Example

Call read_page with these arguments:

{
  "site_id": "01a1…",
  "path": "/"
}

Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.

Related guides