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; 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, 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. 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
| Name | Type | About |
|---|---|---|
site_idrequired | string | The id of the site. list_sites gives the ids of your sites. |
pathrequired | string | The page to read, such as /. |
comments | one of: open, all | open (default) returns open comment threads on the page; all also returns resolved ones. |
files | string or array of string | Limits the files returned: template, page_css, global_css, partials, scripts, or one by name such as partial:header. |
rendered | boolean | true adds the page as rendered HTML. |
elements | one of: none, bot, all | bot returns the element ids your agent wrote; all also returns the automatic ones. |
file | string | The file to continue reading, from next in an earlier response. |
offset | integer | Where to continue in that file, from next. |
limit | integer | The most characters of file text to return. |
elements_offset | integer | Where to continue the element list, from elements_next. |
version | integer | The draft version from next. If the draft changed in between, the call fails with page_changed. |
cursor | string | next_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
- Pages and partialsOne page per address, with shared headers and footers.
- Images, fonts, PDFs and videoUpload files and use them on your pages.