Estimate the credit cost of scanning one or more repositories before starting a scan.
completed or partial cost estimation with a positive total_credits value is required before calling POST /scans.
Cost estimations run asynchronously. The POST returns a record in pending or running state; poll GET /cost-estimations/{id} until status reaches completed, partial, or failed.
write| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Friendly label for this estimation. Max 255 chars. |
repos | object[] | Yes | 1–20 repositories to estimate. Each entry is one of the repo shapes below, identified by source. |
source field.
connected — a repository already synced to Hacktron via GitHub, GitLab, or Bitbucket| Field | Type | Required | Description |
|---|---|---|---|
source | "connected" | Yes | Discriminator. |
repo_url | string | Yes | Full HTTPS URL of the repository. Max 500 chars. |
branch | string | Yes | Branch to estimate. Max 255 chars. |
github_installation_id | int | No | Specific GitHub App installation ID to use. |
public — a public git repository Hacktron can clone anonymously| Field | Type | Required | Description |
|---|---|---|---|
source | "public" | Yes | Discriminator. |
repo_url | string | Yes | Full HTTPS URL. Max 500 chars. |
branch | string | Yes | Branch to estimate. Max 255 chars. |
upload — a previously uploaded archive| Field | Type | Required | Description |
|---|---|---|---|
source | "upload" | Yes | Discriminator. |
archive_id | UUID | Yes | ID of a scan archive you uploaded. |
201 Created — the estimation is queued. Poll GET /cost-estimations/{id} until status reaches a terminal value.
| Status | Meaning |
|---|---|
completed | All repos were estimated successfully. total_credits is populated. |
partial | Some repos completed, others failed. Check repo_results[].status for details. |
failed | The whole estimation failed. error contains a message. |
id as cost_estimation_id to POST /scans to start the scan. The scan must use repositories and branches that were included in the estimate.
400 — invalid or missing fields (for example, more than 20 repos, invalid source, or missing repo_url).401 / 403 — authentication or scope failure.