# DeployExplanation

> What went wrong and how to fix it.

What went wrong and how to fix it. Rules first, then an AI summary (labelled).

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `deployment_id` * | string |  |
| `status` * | `available`, `pending`, `not_applicable` |  |
| `category` | [FailureCategory](/docs/api/objects/failure-category/) |  |
| `cause` | string |  |
| `fix` | object |  |
| `evidence` | array of object |  |
| `confidence` | `low`, `medium`, `high` |  |
| `generated_by` | `rules`, `ai` |  |
| `ai_generated` | boolean | When true the UI labels the text "AI" with a feedback control. |

\* always present

## Example

```json
{
  "deployment_id": "dep_01jbx2m9k7q4r8t5v6w3y0z1dp",
  "status": "available",
  "category": "port_mismatch",
  "cause": "Your app listens on port 8080 but we expected 3000.",
  "fix": {
    "summary": "Set port: 8080 on the web service.",
    "actions": [
      {
        "kind": "one_click",
        "label": "Set port to 8080",
        "command": "guv services update web --port 8080",
        "api": {
          "method": "PATCH",
          "path": "/v1/projects/primecarers/services/web",
          "body": {
            "port": 8080
          }
        }
      },
      {
        "kind": "open_pr",
        "label": "Ask AI to fix (opens a PR)"
      }
    ]
  },
  "evidence": [
    {
      "source": "runtime_log",
      "timestamp": "2026-10-23T14:04:02Z",
      "text": "Server listening on http://0.0.0.0:8080"
    }
  ],
  "confidence": "high",
  "generated_by": "rules",
  "ai_generated": false
}
```

## Used by

- [Why a deployment failed and how to fix it](/docs/api/deployments/#why-a-deployment-failed-and-how-to-fix-it)
