Checks whether a git repository is publicly reachable or accessible via one of your linked version control accounts, before creating a resource that would clone it.
Required permission
Account > Git > General > Read
Request body
- {object}
projectUrl
string requiredHTTPS URL of the git repository to check access for.projectType
string requiredThe version control provider the repository belongs to.one ofbitbucket, gitlab, github, self-hosted, azureprojectBranch
stringOptional branch to check.vcsLinkId
stringIf provided, only checks access via this specific linked account.min length24max length24accountLogin
stringIf provided, only checks access via the linked account with this login.selfHostedVcsId
stringIf `projectType` is `self-hosted`, the ID of the self-hosted VCS provider.
Response body
- {object}Response object.
data
{object} requiredResult data.publicRepo
boolean requiredWhether the repository is publicly reachable without a linked account.accessible
boolean requiredWhether the repository can be accessed — publicly or via a linked account.vcsLinkId
stringThe linked account that can access the repository. Present when `reason` is `linked-account`.accountLogin
stringLogin of the linked account that can access the repository. Present when `reason` is `linked-account`.reason
string requiredWhy the repository is (in)accessible: `public` (reachable anonymously), `linked-account` (a linked account can access it), `no-linked-access` (no linked account can access it), or `not-found` (the repository URL does not resolve).one ofpublic, linked-account, no-linked-access, not-found
API
CLI
JS Client
POST /v1/integrations/vcs/repo-access
POST /v1/teams/{teamId}/integrations/vcs/repo-access
Example request
Request body
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"projectUrl":"https://github.com/northflank-examples/next-js-example","projectType":"github","projectBranch":"main","accountLogin":"example-user"}' \
https://api.northflank.com/v1/integrations/vcs/repo-accessExample response
200 OK
The access status of the repository.
JSON
{
"data": {
"publicRepo": false,
"accessible": true,
"vcsLinkId": "63ebb6ce2ccc6c7affdbf253",
"accountLogin": "example-user",
"reason": "linked-account"
}
}