Skip to main content
GET
Get file contents
This endpoint is rate limited. Each call counts toward your daily request limit.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>. The token may be a Sourcebot API key, OAuth access token, or scoped access token, subject to endpoint requirements.

Query Parameters

path
string
required
repo
string
required
ref
string

Response

File source and metadata.

source
string
required
language
string
required
path
string
required
repo
string
required
repoCodeHostType
enum<string>
required
Available options:
github,
gitlab,
gitea,
gerrit,
bitbucketServer,
bitbucketCloud,
genericGitHost,
azuredevops
webUrl
string
required
repoDisplayName
string
repoExternalWebUrl
string
externalWebUrl
string
blobSha
string
servedFrom
object

Where the file was actually read from, when that differs from the requested repository and path (e.g., an owner repository's knowledge-base/ path served from its knowledge repository).