# at.happyproto.fleet.getRetention

> Published by [happyproto.at](https://lexicon.garden/identity/did:plc:mo7vq4jbioxwafy5zkcc3eux)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.fleet.getRetention)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.fleet.getRetention/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.fleet.getRetention/examples)

## Definitions

### `at.happyproto.fleet.getRetention#cohort`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cohort` | `string` | Yes | Month the cohort was first seen. |
| `eligible30` | `integer` | No | Instances old enough to have survived 30 days. THIS is the denominator, not `started` — a cohort ten days old has not failed to survive thirty. |
| `eligible60` | `integer` | No |  |
| `eligible90` | `integer` | No |  |
| `started` | `integer` | Yes |  |
| `survived30` | `integer` | No |  |
| `survived60` | `integer` | No |  |
| `survived90` | `integer` | No |  |

### `at.happyproto.fleet.getRetention`

**Type**: `query`

Survival by first-seen cohort. Manual-mode instances are excluded: they have no reporting cadence to miss, so their silence is not churn. Admin only.

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cohorts` | `array` | Yes |  |
| `have` | `integer` | No | History available, when accruing. |
| `need` | `integer` | No | History required, when accruing. |
| `status` | `string` | Yes | Why a figure is absent. Branch on this, never on field presence. |
| `unit` | `string` | No |  |

#### Errors

- **AuthRequired**: This endpoint requires an authenticated caller.
- **Forbidden**: The caller is not a HappyProto admin.
- **Upstream**: The telemetry store could not be queried.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "cohort": {
      "properties": {
        "cohort": {
          "description": "Month the cohort was first seen.",
          "type": "string"
        },
        "eligible30": {
          "description": "Instances old enough to have survived 30 days. THIS is the denominator, not `started` — a cohort ten days old has not failed to survive thirty.",
          "type": "integer"
        },
        "eligible60": {
          "type": "integer"
        },
        "eligible90": {
          "type": "integer"
        },
        "started": {
          "type": "integer"
        },
        "survived30": {
          "type": "integer"
        },
        "survived60": {
          "type": "integer"
        },
        "survived90": {
          "type": "integer"
        }
      },
      "required": [
        "cohort",
        "started"
      ],
      "type": "object"
    },
    "main": {
      "description": "Survival by first-seen cohort. Manual-mode instances are excluded: they have no reporting cadence to miss, so their silence is not churn. Admin only.",
      "errors": [
        {
          "description": "This endpoint requires an authenticated caller.",
          "name": "AuthRequired"
        },
        {
          "description": "The caller is not a HappyProto admin.",
          "name": "Forbidden"
        },
        {
          "description": "The telemetry store could not be queried.",
          "name": "Upstream"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cohorts": {
              "items": {
                "ref": "#cohort",
                "type": "ref"
              },
              "type": "array"
            },
            "have": {
              "description": "History available, when accruing.",
              "type": "integer"
            },
            "need": {
              "description": "History required, when accruing.",
              "type": "integer"
            },
            "status": {
              "description": "Why a figure is absent. Branch on this, never on field presence.",
              "knownValues": [
                "ok",
                "accruing",
                "withheld"
              ],
              "type": "string"
            },
            "unit": {
              "knownValues": [
                "days",
                "snapshots"
              ],
              "type": "string"
            }
          },
          "required": [
            "status",
            "cohorts"
          ],
          "type": "object"
        }
      },
      "type": "query"
    }
  },
  "id": "at.happyproto.fleet.getRetention",
  "lexicon": 1
}
```
