Skip to main content
GET
/
api
/
source
Get file contents
curl --request GET \
  --url https://api.example.com/api/source \
  --header 'Authorization: Bearer <token>'
{
  "source": "<string>",
  "language": "<string>",
  "path": "<string>",
  "repo": "<string>",
  "repoCodeHostType": "github",
  "webUrl": "<string>",
  "repoDisplayName": "<string>",
  "repoExternalWebUrl": "<string>",
  "externalWebUrl": "<string>"
}

Authorizations

Authorization
string
header
required

Send either a Sourcebot API key (sbk_... or legacy sourcebot-...) or, on EE instances with OAuth enabled, an OAuth access token (sboa_...) in the Authorization header.

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