Skip to main content
GET
Typescript (SDK)

Authorizations

Authorization
string
header
required

API key in the format: Bearer {api_token}

Path Parameters

id
string
required

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

Query Parameters

path
string
required

The file, relative to the repository root (e.g. src/routes/index.tsx).

ref
string
default:main

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 file

object
enum<string>
required
Available options:
site_source_file
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
required
sha
string
required

The file's git blob id.

size
integer
required

Bytes.

encoding
enum<string>
required
Available options:
utf8,
base64
content
string
required

The file's content, encoded as encoding says.