Source code

Read source files

Reads up to 50 files by name from head, published, or an explicit version. A single-file read supports line and character ranges; continue truncated reads with nextStartCharacter and the resolved version.

post/websiteSourceCode/files/read

Request

  • Base URL: https://api.cactal.ai/v1
  • URL: https://api.cactal.ai/v1/websiteSourceCode/files/read
  • Auth: HTTP bearer

Request body

websiteIdstring required
target'head' | 'published'

Version alias to read: head (default) or published.

versioninteger

Explicit source version. Takes precedence over target.

namesstring[] required

File names to read (up to 50). Singleton files are addressed by their type name, for example global_css.

startLineinteger

First line to return (1-based, inclusive). Only valid when reading a single file.

endLineinteger

Last line to return (1-based, inclusive). Only valid when reading a single file.

startCharacterinteger

First character to return from the selected line range (1-based, inclusive). Only valid when reading a single file.

endCharacterinteger

Last character to return from the selected line range (1-based, inclusive). Only valid when reading a single file.

Response

The requested files with their contents.

websiteIdstring required

Id of the website.

versioninteger required

Source version that was read. Pass it as version when continuing truncated content.

Changes

No recorded changes to this operation across all 1 revision of this API.