# CredentialHealth

How a credential has been behaving. A credential that keeps failing is switched off for a while (a circuit breaker), so a broken endpoint isn't called on every run, and after repeated breaks until it's tested again.

**Kind:** an object, used in responses.

## Fields

Every field is present in a response; empty ones are `null`.

| Field | Type | Description |
|---|---|---|
| `consecutiveFailures` | `integer` | Failures that count against the credential since it last served a call. |
| `disabledUntilUtc` | `datetime \| null` | While set and in the future, runs skip the credential. |
| `breaks` | `integer` | How many times the breaker has opened since the last success. |
| `offUntilTested` | `boolean \| null` | Switched off after repeated breaks: runs skip the credential until a test of it passes (or its keys or endpoint are changed). Null on a credential saved before this existed, read as false. |
| `lastFailureAtUtc` | `datetime \| null` | When the last failure that counted against the credential happened. |
| `lastFailureReason` | `string \| null` | Why it failed: `Auth`, `Quota`, `Endpoint` or `Unreachable`. |
| `lastTestedAtUtc` | `datetime \| null` |  |
| `lastTestSucceeded` | `boolean \| null` |  |
| `lastTestError` | `string \| null` | A stable code for why the last test failed. |

## Example

```json
{
  "consecutiveFailures": 0,
  "disabledUntilUtc": "2026-10-26T12:00:00.0000000Z",
  "breaks": 0,
  "offUntilTested": false,
  "lastFailureAtUtc": "2026-10-26T12:00:00.0000000Z",
  "lastFailureReason": "...",
  "lastTestedAtUtc": "2026-10-26T12:00:00.0000000Z",
  "lastTestSucceeded": false,
  "lastTestError": "..."
}
```

## Where it's used

- Inside [`ModelCredential`](https://docs.maitento.com/reference/types/model-credential.md)
