Skill: Read Site

Return the source of one of your organization's sites as of its newest draft, with its pages and a list of its images and fonts. Writes nothing.

Read Site returns the current source of a site your organization owns, so the Web Builder can change it without losing what’s there. It comes with the Web Builder, which calls it before every Update Site.

It reads the newest draft, which is what the next change builds on. That can be ahead of what visitors see. It writes nothing.

Parameters

ParameterTypeDescription
site_namestringThe site, as List Sites reports its site_name. Required

Response

FieldDescription
successtrue
modefetch
site_name, usernameThe site and its organization’s slug
htmlThe newest draft’s index.html
cssIts styles.css, or empty when it has none
jsIts script.js, or empty when it has none
pagesEach extra page as { filename, html }
assetsEach image and font as { filename, size, content_type }. The file contents aren’t returned

The response is the same as Update Site’s with fetch_current: true.

When it refuses

A site_name the organization doesn’t have, including another organization’s site, is reported as “not found or you do not have permission to read it”.


Related skills: Update Site | Edit Site | Retrieve Site