---
title: "Diagnose an issue"
method: POST
path: "/projects/{id}/issues/{issueId}/autofix-runs"
tags: ["Autofix"]
---

# Diagnose an issue

`POST /projects/{id}/issues/{issueId}/autofix-runs`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/projects/{id}/issues/{issueId}/autofix-runs`
- Auth: HTTP bearer

Queues a run that diagnoses the issue with AI. The run reads the
issue's runtime logs and, when a push to the project's connected
repository built the deployment that was live when the issue was
last seen, its source at that commit. Poll the run until its status is
`succeeded`, `failed`, or `canceled`.

Autofix must be on for the project. An issue has at most one queued or
running run, a project runs one at a time, and a project starts at most
25 runs, manual and automatic, in any 24 hours.

Project access tokens are refused. A run can open a pull request in
the project's repository, so a person starts it with a platform token
or in the dashboard.

## Path parameters

- `id` string, uuid, required
- `issueId` string, uuid, required

## Response `202`

Queued

- AutofixRun
  - `id` string, uuid, required
  - `project_id` string, uuid, required
  - `issue_id` string, uuid, required
  - `trigger` 'manual' | 'new_issue' | 'regression', required: What started the run. `manual` is a request; `new_issue` and `regression` are automatic runs for an issue that appeared or reopened.
  - `status` 'queued' | 'running' | 'succeeded' | 'failed' | 'canceled', required: Where a run is. `canceled` means the project's settings or plan stopped allowing the run before it finished; `failure_code` says which.
  - `max_stage` 'diagnose' | 'pull_request', required: How far a run may go. `diagnose` stops at a root-cause diagnosis. `pull_request` may also open a draft pull request with a fix in the project's connected repository.
  - `stage_reached` 'diagnose' | 'pull_request': How far a run may go. `diagnose` stops at a root-cause diagnosis. `pull_request` may also open a draft pull request with a fix in the project's connected repository.
  - `diagnosis` AutofixDiagnosis
    - `summary` string, required: One or two sentences on what goes wrong.
    - `root_cause` string, required
    - `evidence` AutofixEvidence[], required
      - `kind` 'log' | 'code' | 'other', required
      - `detail` string, required
      - `location` string: A file and line, or a log timestamp. Absent when the evidence has none.
    - `suggested_fix` string, required
    - `confidence` 'low' | 'medium' | 'high', required
    - `fixable` boolean, required: Whether a change to the project's code would fix the issue.
    - `files` string[], required: Repository paths a fix would change.
  - `patch` AutofixPatch: The fix the model proposed, applied to the deployed commit. Present whenever the run opened a pull request, and when a valid fix could not be published.
    - `title` string, required
    - `edits` AutofixEdit[], required
      - `path` string, required
      - `old_text` string, required
      - `new_text` string, required
  - `pull_request` AutofixPullRequest: The draft pull request the run opened on the connected repository.
    - `number` integer, required
    - `url` string, uri, required
    - `branch` string, required: The branch the fix is on, `volcano/autofix/<run id>`.
    - `state` 'open' | 'merged' | 'closed', required
    - `closed_at` string, date-time: When the pull request was merged or closed.
    - `deployed_at` string, date-time: When a deployment that includes the merged fix went live. The issue resolves then, unless it occurred again since. When more than 20 deployments went live after the merge before Volcano checked, it is the merge time instead.
  - `pull_request_skipped` 'source_unavailable' | 'pull_request_open' | 'not_fixable' | 'low_confidence' | 'no_patch' | 'permission_missing' | 'repository_changed' | 'publish_failed': Why a run whose `max_stage` is `pull_request` opened no pull request. The diagnosis stands either way.
  - `commit_sha` string: The commit the diagnosis read, when a push to the connected repository deployed the resource. Absent when the run read logs only.
  - `failure_code` string: Why the run failed or was canceled, or why its last attempt will be retried. A queued run paused while Autofix is unavailable reports `feature_unavailable`; it resumes without spending an attempt when Autofix returns. Other values are `model_request_rejected`, `model_unavailable`, `model_refused`, `no_diagnosis`, `budget_exhausted`, `timed_out`, `attempts_exhausted`, `autofix_disabled`, `plan_required`, `issue_not_found`, or `internal_error`. Runs that ended before Volcano picked the models for every run may also report `api_key_rejected`, `settings_changed`, or `managed_models_unavailable`; no new run reports them.
  - `failure_message` string
  - `created_at` string, date-time, required
  - `started_at` string, date-time
  - `completed_at` string, date-time

## Other responses

- `400`: The request is invalid.
- `403`: The owner's plan does not include autofix, or the request used a project access token.
- `404`: Project or issue not found. Code `feature_unavailable` means autofix is not available in this environment.
- `409`: Autofix is off for the project, or the issue already has a queued or running run.
- `429`: The project started its limit of runs in the last 24 hours.
- `501`: Autofix is not available in local mode.
- `503`: The owner's plan could not be resolved. Retry later.

## Changes

- **2026-10-26** `4b0676e06128`: 3 breaking
  - removed the required property `model` from the response with the `202` status
  - removed the required property `provider` from the response with the `202` status
  - removed the required property `usage` from the response with the `202` status
- **2026-10-23** `5113707385cc`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/issues/:issueId/autofix-runs/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
