pagehive

read_pages

Read the source of up to 10 draft pages in one call: for each page its template, page CSS, global CSS, the partials it includes and the scripts it references, as read_page returns them without rendered HTML, element ids or comments.

Draft contentRead-onlyAll plansUpdated

What it does

Read the source of up to 10 draft pages in one call: for each page its template, page CSS, global CSS, the partials it includes and the scripts it references, as read_page returns them without rendered HTML, element ids or comments. files limits that set for every page, as in read_page. All pages share one budget of 32000 characters of file text, filled in the order of paths; a page that does not fit has complete false and next, the arguments (path included) for read_page to continue it. version is the current draft version, which patch_page accepts as base_version; an optional version must equal it, or the call fails with validation_failed reason page_changed. A path that is not a page on the draft fails the whole call with not_found, details.index and details.path. Repeated paths are read once.

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.
pathsrequiredarray of stringUp to 10 pages to read, such as / and /about, in the order to read them.
filesstring or array of stringLimits the files returned for every page, as in read_page.
versionintegerThe draft version you expect. If the draft changed, the call fails with page_changed.
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.

Example

Call read_pages with these arguments:

{
  "site_id": "01a1…",
  "paths": [
    "/",
    "/about"
  ]
}

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

Related guides