Getting started
Back to home
Getting started

Get repository details

Read metadata for an accessible repository, including its available branches. GitHub installation credentials stay on the server.

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

Path parameters

NameValue
repositoryIdRequired resource ID from an earlier API response.

Query parameters

NameTypeRequiredLimits
installationIdstringNoAt least 1 character(s)
branchstringNoSee schema
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}" \
  --header "Authorization: Bearer $HCODE_API_KEY"

Response

The JSON shape is defined in the response schema.

Response schema
{
  "type": "object",
  "properties": {
    "repositoryUrl": {
      "type": "string"
    },
    "fullName": {
      "type": "string"
    },
    "defaultBranch": {
      "type": "string"
    },
    "branches": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "authMode": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "fromCache": {
      "type": "boolean"
    },
    "rateLimitResetAt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "detected": {
      "type": "boolean"
    },
    "framework": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "installCommand": {
          "type": "string"
        },
        "buildCommand": {
          "type": "string"
        },
        "startCommand": {
          "type": "string"
        },
        "outputDirectory": {
          "type": "string"
        },
        "port": {
          "type": "integer"
        }
      },
      "required": [
        "name",
        "installCommand",
        "buildCommand",
        "startCommand",
        "outputDirectory"
      ],
      "additionalProperties": true
    },
    "runtimeChoiceRequired": {
      "type": "boolean"
    },
    "runtimeChoiceReason": {
      "type": "string"
    },
    "runtimeOptions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [],
  "additionalProperties": true
}

See errors and retries for failure responses.