CorefinityCorefinityDocs
Open the Control PanelControl Panel
Deployments · 3 of 10

List a repository's branches

Asks the git provider for the branches of one repository the connection can see, the default branch first, then by name, at most 200. You must be someone who may deploy the site.

GET/api/corestack/sites/{site}/deployments/branches

Path parameters

siteintegerRequired

The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.

Query parameters

connectionintegerRequired

The id of a repository connection you may use on this site, as the settings list them in connections.

repostringRequired

The repository as owner/name, or group/subgroup/name on GitLab. Up to 200 characters.

Returns

200 The branches.

Fields of the 200 answer
branchesarray of objectsRequired

Up to 200 items.

Fields of each item
defaultbooleanRequired
namestringRequired
shastring or nullRequired

The branch's newest commit.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404noneCheck the id. You see only what your account can reach.
409needs_reauthThe repository's connection is gone or needs authorising again. Reconnect the repository.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.
502noneRead the message; it says what happened.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl 'https://manage.corefinity.com/api/corestack/sites/1042/deployments/branches?connection=4217&repo=northwind-digital%2Fharbourandfinch' \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "branches": [
    {
      "default": true,
      "name": "main",
      "sha": "9730595c6ec7aa59b77674ada74e30d961b1817c"
    },
    {
      "default": false,
      "name": "develop",
      "sha": "4b1f0c9d2e7a8b6c5d4e3f2a1b0c9d8e7f6a5b4c"
    }
  ]
}
Try it
Held in this tab's memory only. Never stored or sent to us.

Use a token with only the read scope. How to make one

Was this helpful?
Open in ClaudeOpen in ChatGPT