Create cost estimation
Cost Estimations
Create cost estimation
Estimate the credit cost of scanning one or more repositories before starting a scan.
POST
Create cost estimation
A cost estimation resolves the repositories you plan to scan, detects applications within them, and returns a predicted credit cost. A
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.
Scope required:
writeRequest
Body
Repo shapes
Repositories use a discriminated union on thesource field.
connected — a repository already synced to Hacktron via GitHub, GitLab, or Bitbucket
public — a public git repository Hacktron can clone anonymously
upload — a previously uploaded archive
Response
201 Created — the estimation is queued. Poll GET /cost-estimations/{id} until status reaches a terminal value.
Terminal statuses
Once in a terminal state, an estimation is immutable. Pass its
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.
Errors
400— invalid or missing fields (for example, more than 20 repos, invalidsource, or missingrepo_url).401/403— authentication or scope failure.