Sites

List a site's source files

Changed on

Lists every file in the site's repository at ref, main by default. Pass path to list only the files under one directory.

This is how an agent outside Crevio builds a site: list the files, read the ones you will change with GET /sites/{id}/source/file, then send your edits to POST /sites/{id}/source/commits (whole files) or POST /sites/{id}/source/commits/diff (a unified diff) with expected_head_sha set to head_sha, and put the commit live with POST /sites/{id}/deploy.

ref is a branch, a tag or a commit sha; an unknown one answers 404 with param: ref. Every read reports commit_sha, the commit it read, so later reads can pass it as ref to stay on one revision, and head_sha, where main is now, to pass as expected_head_sha when you commit.

Fails with 422 repository_missing when the site has no repository yet, and 503 repository_unreachable when its repository does not answer in time (retry).

get/sites/{id}/source/files

Request

  • Base URL
    https://api.crevio.co/v1
  • Auth
    API key in header Authorization

Path parameters

id, string required

The resource's ID, as returned in its id field

Query parameters

path, string

A directory to list, relative to the repository root (e.g. src/routes). Omit for the whole repository.

ref, string

The branch, tag or commit sha to read (a sha prefix of 7 or more characters works for commits on main). Defaults to main.

Response

The files at ref

object required
object, 'site_source_tree' required
head_sha, string required

Where main points now. Pass it as expected_head_sha when you commit.

ref, string required

The ref this read asked for: main unless you passed one.

commit_sha, string required

The commit ref resolved to, which this answer was read at. Pass it as ref to read more of the same revision.

path, string nullable required

The directory listed, normalized; null for the whole repository.

files, object[] required

Changes

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    2 more changes in this revision