Rustine docs
API › Scans

Start a scan

Starts a scan of one of your project's sites, or an analysis of a GitHub repository. The scan runs in the background: the answer comes back at once (201, status queued) and you follow it with Get a scan.

POSThttps://api.rustine.io/v1/targets/{target_id}/scans

OAuth permission: scans:run · an API key has them all

Open in ClaudeOpen in ChatGPT

A full audit only runs on a proved site (DNS, file or meta tag): the law forbids testing a site you do not control. Without a proof, ask for quick: Rustine only reads what any visitor sees. If a scan of the site is running, or one of the same kind finished within the hour, you get that one (200, reused: true) and nothing is counted.

Path parameters

  • target_idstringrequired

    Target id (a site or a repository of a project).

Headers

  • Idempotency-Keystringoptional

    A unique key (1 to 255 printable characters, a UUID is fine) to retry this request safely: the first response is replayed for 24 hours; the same key with another request answers 409 idempotency_conflict.

Request body

  • kindstringoptional

    quick (default for a site), audit (verified sites, Solo and Pro) or repository (the only kind, and the default, for a repository).

    quickauditrepository

Response

  • idstring

    Scan id.

  • objectstring
  • target_idstring

    Target scanned.

  • kindstring

    quick (what any visitor could see), audit (adds deeper read-only checks, verified sites only) or repository (analysis of a GitHub repository).

    quickauditrepository
  • statusstring

    Scans run asynchronously: poll until done or failed.

    queuedrunningdonefailed
  • scorenumber | null

    Score out of 100, once done.

  • gradestring | null

    Grade, once done.

    ABCDF
  • coveragenumber | null

    Share of the checks that could run (0 to 1), once done.

  • audit_fallbackboolean

    An audit was asked but the site's proof no longer held: a quick scan ran instead and no audit was counted.

  • reusedboolean

    True when the request got an existing scan instead of a new one (one already running, or one of the same kind in the last hour); nothing was counted.

  • next_real_scan_atstring | null

    When reused because of a recent scan: when a new scan of this kind may start.

  • created_atstring

    When the scan was requested.

  • finished_atstring | null

    When the scan finished.

Errors

Statuserror.codeWhat happens
400body_invalidThe request body is not valid JSON. Check the Content-Type: application/json header.
400parameter_invalidA parameter is missing or invalid; param names it.
400target_kind_invalidThe scan kind does not fit the target: repository for a GitHub repository, quick or audit for a site.
400idempotency_key_invalidThe Idempotency-Key header must be 1 to 255 printable characters.
401authentication_requiredNo key in the request. Pass it in the Authorization: Bearer rst_… header, never in the address.
401invalid_api_keyThe key or OAuth token is wrong, revoked or expired. Check it is copied in full, or create a new key.
402api_plan_requiredThe workspace is on the Free plan. The API comes with Pro, or on a 14-day trial with Solo.
402api_trial_endedSolo's 14-day trial is over. Move to Pro: your keys work again at once.
402audit_not_in_planThe Free plan runs quick scans only; the full audit comes with Solo and Pro.
402repositories_not_in_planGitHub repository analyses come with Solo and Pro.
402scan_quota_exceededThis period's quick scans are used up, and no pack credit is left.
402audit_quota_exceededThis period's full audits are used up, and no pack credit is left.
402project_pausedThe project is paused: your plan covers fewer projects than your workspace has. Its issues stay readable, but nothing new runs.
402domain_takenOn the Free plan, a domain another free account already follows cannot be added or scanned.
403scope_missingThe OAuth token lacks the permission this route needs (shown on its page). Reconnect the agent to grant it. An API key has every permission.
404resource_not_foundNothing with this id in the key's workspace. An object of another workspace answers the same: its existence is never revealed.
409proof_requiredThe site must first be proved yours (full audit, fix, marking). Prove it in the app: DNS, file or meta tag.
409site_excludedThe owner of this site asked not to be scanned. Rustine will not scan it.
409github_unavailableGitHub repository analyses are not available right now.
409idempotency_conflictThis Idempotency-Key was already used for another request (method, path or body). A new action takes a new key.
409idempotency_in_progressA request with this Idempotency-Key is still running. Retry in a moment.
429rate_limitedToo many requests for this key (120 per minute). Wait Retry-After seconds.
429repository_analyses_limit_reachedThe workspace started many repository analyses in the last 24 hours. Try again later.
500internal_errorAn error on our side, reported automatically. Retry later; give the Request-Id to support if it comes back.
503service_unavailableRustine is unavailable for a moment. Retry with the same Idempotency-Key.
503platform_busyRustine is not starting new scans for a few minutes. Retry later; nothing was charged.

↵ Enter to open, Esc to close