---
title: Remediate a finding
description: Prepare a fix for a finding, with an optional pull request.
url: https://www.hacktron.ai/docs/api/findings/remediate-finding
---

# Remediate a finding

Starts a [Remediation](/docs/platform/automations/remediation) run for a finding, as **Remediate** in Hacktron does. A Hacktron agent writes a fix. Your organisation's **Remediation pull requests** setting decides whether it opens a pull or merge request or keeps the fix in Hacktron. With **Ask every time**, runs started through the API open a pull request. Use the finding's UUID or display id. You need the member role or above.

Only one run per finding goes at a time. `started` is `false` when Hacktron returns the finding's latest run instead of starting another: one in progress, one with an open fix pull request, one with a fix ready in Hacktron, or one that ended without a fix. A new run starts only when the finding has none, or its latest failed or had its pull request closed.

The run is charged to the organisation's [automation credits](/docs/platform/automations/credits). When the organisation has run out, the API returns `403 Forbidden`. Check the balance with [`GET /credits/automation`](/docs/api/credits/get-automation-credit-balance).

Follow the run with [`GET /findings/{id}/remediation`](/docs/api/findings/get-finding-remediation) until `pr_url` is set or `status` is `fix_ready` or another final state.

## Request

`POST /findings/{id}/remediate`

Send an [API key](/docs/api/authentication) with the `write` scope in the `X-Api-Key` header.

:::examples

```bash title="Request" wrap=false
curl -X POST "https://api.hacktron.ai/v1/findings/HAC-FD-1104/remediate" \
  -H "X-Api-Key: $HACKTRON_API_KEY"
```

```json title="Response 201 Created" showLineNumbers=false wrap=false
{
  "id": "0d9e8f7a-6b5c-4d3e-9f2a-1b0c9d8e7f6a",
  "finding_uuid": "7c6b5a49-3827-4615-a4b3-c2d1e0f9a8b7",
  "status": "dispatched",
  "pr_url": null,
  "failure_reason": null,
  "created_at": "2026-11-08T10:30:00.000Z",
  "url": "https://app.hacktron.ai/acme/automations/runs/0d9e8f7a-6b5c-4d3e-9f2a-1b0c9d8e7f6a",
  "started": true
}
```

:::

### Path parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `id` | string, required | Finding UUID or display id (KEY-FD-NUMBER, e.g. HAC-FD-1104). |

## Responses

### 201 Created

| Field | Type | Description |
| --- | --- | --- |
| `id` | string (uuid), required | Run id. |
| `finding_uuid` | string (uuid), required | Finding the run fixes. |
| `status` | string, required | `dispatched` while the fix is generated; `pr_created` when its pull request is open; `fix_ready` when the fix is ready in Hacktron without a pull request; `no_fix`, `false_positive`, `failed`, or `stopped_cap_exceeded` when the run ends without a fix; `pr_closed` when the finding was fixed some other way. |
| `pr_url` | string, required, nullable | The fix pull request, once it is open. |
| `failure_reason` | string, required, nullable | Why the run failed or found no fix. |
| `created_at` | string, required | When the run started. |
| `url` | string, required | The run in Hacktron. |
| `started` | boolean, required | False when the finding's latest run is returned instead of starting another: one in progress, one with an open fix pull request, one with a fix ready in Hacktron, or one that ended without a fix (no_fix, false_positive, stopped_cap_exceeded). A new run starts only when the finding has none or its latest failed or had its pull request closed. |
