Getting started
Back to home
Getting started

List repository branches

List branches for an accessible repository. Use the repository ID returned by listSourceRepositories.

GET/api/customer/v1/source/repositories/{repositoryId}/branches

Path parameters

NameValue
repositoryIdRequired resource ID from an earlier API response.

Query parameters

NameTypeRequiredLimits
installationIdstringNoAt least 1 character(s)
projectIdstringNoAt least 1 character(s)

Example request

Set HCODE_BASE_URL and HCODE_API_KEY as shown in Getting started. Replace resource variables with your own IDs.

curl --request GET "$HCODE_BASE_URL/api/customer/v1/source/repositories/${REPOSITORY_ID}/branches" \
  --header "Authorization: Bearer $HCODE_API_KEY"

Response

The JSON shape is defined in the response schema.

Response schema
{
  "type": "object",
  "properties": {
    "branches": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "branches"
  ],
  "additionalProperties": true
}

See errors and retries for failure responses.