Getting started
Back to home
Getting started

Inspect application source

Inspect an accessible repository or a completed ZIP upload for build settings. Upload inspection reads bounded manifest files without extracting or executing the archive.

POST/api/customer/v1/source/inspect

Request body

Send JSON with Content-Type: application/json. Nested fields and accepted values are listed in the schema.

FieldTypeRequired
repositoryUrlstringNo
branchstringNo
rootDirectorystringNo
githubInstallationIdintegerNo
uploadIdstringNo
projectIdstringNo
Full request schema
{
  "type": "object",
  "properties": {
    "repositoryUrl": {
      "type": "string"
    },
    "branch": {
      "type": "string"
    },
    "rootDirectory": {
      "type": "string"
    },
    "githubInstallationId": {
      "type": "integer",
      "minimum": 1
    },
    "uploadId": {
      "type": "string",
      "minLength": 1
    },
    "projectId": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [],
  "additionalProperties": false
}

Example request

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

curl --request POST "$HCODE_BASE_URL/api/customer/v1/source/inspect" \
  --header "Authorization: Bearer $HCODE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "repositoryUrl": "https://github.com/example/app"
}'

Response

The JSON shape is defined in the response schema.

Response schema
{
  "type": "object",
  "properties": {
    "source": {
      "type": "string"
    },
    "dockerfile": {
      "type": "object",
      "properties": {
        "present": {
          "type": "boolean"
        },
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "exposedPorts": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      },
      "required": [
        "present"
      ],
      "additionalProperties": true
    },
    "framework": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "packageManager": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "suggestedBuildMode": {
      "type": "string"
    },
    "suggestedStartCommand": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "suggestedPort": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "suggestedRuntimeIntent": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "workerLikely": {
      "type": "boolean"
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "confidence": {
      "type": "string"
    },
    "operationId": {
      "type": "string"
    },
    "operations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "href": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "href"
        ]
      }
    }
  },
  "required": [
    "source",
    "dockerfile",
    "suggestedBuildMode",
    "workerLikely",
    "confidence"
  ],
  "additionalProperties": true
}

See errors and retries for failure responses.