Skip to main content
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: write

Request

Body

Repo shapes

Repositories use a discriminated union on the source 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, invalid source, or missing repo_url).
  • 401 / 403 — authentication or scope failure.