> ## Documentation Index
> Fetch the complete documentation index at: https://docs.complior.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Fix Endpoints

> Preview, apply, and undo compliance fixes. Batch operations with validation.

## Preview

### `GET /fix/preview`

Preview all available fixes without applying.

```bash theme={null}
curl http://localhost:3578/fix/preview
```

**Response:**

```json theme={null}
{
  "fixes": [
    {
      "checkId": "no-disclosure",
      "type": "code",
      "strategy": "disclosure-inject",
      "description": "Add AI disclosure system message for Art.50 transparency",
      "file": "src/agent.ts",
      "line": 12,
      "diff": "  messages: [\n+   { role: 'system', content: 'You are an AI assistant. Users must be informed they are interacting with AI per EU AI Act Art.50.' },\n    { role: 'user', content: userInput }",
      "scoreImpact": "+5"
    }
  ],
  "count": 24
}
```

***

### `POST /fix/preview`

Preview fix for a specific finding.

**Request body:**

```json theme={null}
{
  "checkId": "no-disclosure",
  "obligationId": "OBL-050",
  "useAi": false
}
```

***

## Apply

### `POST /fix/apply`

Apply a single fix.

**Request body:**

```json theme={null}
{
  "checkId": "no-disclosure",
  "obligationId": "OBL-050",
  "useAi": false
}
```

**Response:** `FixResult` with applied diff, new score, and evidence entry ID.

***

### `POST /fix/apply-and-validate`

Apply fix and immediately re-scan to validate the result.

**Request body:** Same as `/fix/apply`

**Response:**

```json theme={null}
{
  "result": { "applied": true, "checkId": "no-disclosure" },
  "validation": { "scoreBefore": 40, "scoreAfter": 48, "findingResolved": true }
}
```

***

### `POST /fix/apply-all`

Batch apply all available fixes.

**Request body:**

```json theme={null}
{
  "useAi": false,
  "projectPath": "."
}
```

**Response:**

```json theme={null}
{
  "results": [...],
  "summary": { "applied": 29, "failed": 0, "skipped": 3 },
  "unfixedFindings": [...]
}
```

***

## Undo

### `POST /fix/undo`

Revert a previously applied fix.

**Request body:**

```json theme={null}
{
  "id": 5
}
```

Omit `id` to undo the most recent fix.

***

### `GET /fix/history`

List all applied fixes with timestamps, diffs, and undo availability.

```bash theme={null}
curl http://localhost:3578/fix/history
```
