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

# Get subscription delivery health

> Returns a consolidated, non-secret delivery-health rollup for one subscription — the "why did this tenant stop receiving events" view. The existence gate runs first, so an absent, soft-deleted, or cross-tenant id returns a uniform `404 not_found`. The counts cover the measured interval `[window_start, snapshot_at)`. The auto-disable verdict and the last success and failure are reported whenever they happened.



## OpenAPI

````yaml /pt/openapi/v3-current/streaming-hub.yaml get /v1/subscriptions/{id}/health
openapi: 3.1.0
info:
  title: Lerian Streaming Hub API
  version: 1.2.0
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  license:
    name: Lerian Studio General License
  description: >-
    The Streaming Hub control-plane API. Streaming Hub is Lerian's managed
    event-delivery edge: it consumes CloudEvents from the platform's internal
    streaming backbone and fans them out to a tenant's own external destinations
    — webhooks, Amazon SQS, RabbitMQ, Amazon EventBridge, or a pull inbox. This
    API lets a tenant browse the manifest-fed event catalog, create and manage
    delivery subscriptions, verify and rotate their credentials, read delivery
    health, and pull entitled events.


    An RFC 9457 `application/problem+json` error body carries `title` and
    `status`. An error the hub raises adds `type`, `detail`, and a stable
    low-cardinality `code` you can branch on; a request the framework rejects
    before the operation runs, such as a malformed or schema-invalid one,
    carries no `code`. Mutating operations require an `X-Idempotency` header for
    at-most-once semantics; a replayed request returns the original response
    byte-for-byte with `X-Idempotency-Replayed: true`. The catalog and the pull
    events surface are tenant-scoped through the bearer JWT; the operational
    probe endpoints (`/healthz`, `/readyz`, `/version`, `/runtime`, `/metrics`)
    are unauthenticated.
servers:
  - url: https://streaming-hub.sandbox.lerian.net
security:
  - BearerAuth: []
tags:
  - name: Catalog
    description: Browse the manifest-fed catalog of event types available for subscription.
  - name: Subscriptions
    description: >-
      Create, read, update, and delete delivery subscriptions, and drive the
      destination verification lifecycle (ping, verify, credential, delegated
      grant, secret rotation, health).
  - name: Event Delivery
    description: >-
      Pull entitled events for a pull-sink subscription
      (cursor-as-acknowledgment read).
  - name: Dashboard
    description: >-
      The read-only operational dashboard: a consistent snapshot of ingestion,
      push delivery, and pull eligibility, plus the paged list of subscriptions
      that need attention. It never consumes events and never returns a secret.
  - name: Admin
    description: Cross-tenant operator forensics. Requires an operator authorization scope.
  - name: Operational
    description: Unauthenticated liveness, readiness, build, runtime, and metrics probes.
paths:
  /v1/subscriptions/{id}/health:
    get:
      tags:
        - Subscriptions
      summary: Get subscription delivery health
      description: >-
        Returns a consolidated, non-secret delivery-health rollup for one
        subscription — the "why did this tenant stop receiving events" view. The
        existence gate runs first, so an absent, soft-deleted, or cross-tenant
        id returns a uniform `404 not_found`. The counts cover the measured
        interval `[window_start, snapshot_at)`. The auto-disable verdict and the
        last success and failure are reported whenever they happened.
      operationId: getSubscriptionHealth
      parameters:
        - $ref: '#/components/parameters/SubscriptionId'
      responses:
        '200':
          description: The delivery-health rollup.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionHealth'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/MeteredServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
      security:
        - BearerAuth: []
components:
  parameters:
    SubscriptionId:
      name: id
      in: path
      required: true
      description: The unique identifier of the subscription (UUIDv7).
      schema:
        type: string
        format: uuid
  headers:
    RateLimitLimit:
      description: >-
        The requests this tenant may make in one window of this route's
        allowance.
      schema:
        type: integer
        examples:
          - 60
    RateLimitRemaining:
      description: The requests left in the current window. `0` on a refusal.
      schema:
        type: integer
        examples:
          - 59
    RateLimitReset:
      description: The Unix time, in seconds, at which the current window ends.
      schema:
        type: integer
        examples:
          - 1789499562
    RetryAfter:
      description: The whole seconds to wait before a retry. Always at least `1`.
      schema:
        type: string
        examples:
          - '1'
  schemas:
    SubscriptionHealth:
      type: object
      additionalProperties: false
      description: >-
        The consolidated, non-secret delivery-health rollup for one
        subscription.
      properties:
        subscription_id:
          type: string
          format: uuid
          description: The subscription the rollup describes.
          examples:
            - 0192f1a0-0000-7000-8000-00000000a001
        enabled:
          type: boolean
          description: >-
            Whether delivery is enabled: `false` once auto-disable trips; `POST
            /v1/subscriptions/{id}/verify` re-enables it.
          examples:
            - true
        verification_state:
          $ref: '#/components/schemas/VerificationState'
        status:
          $ref: '#/components/schemas/HealthStatus'
        snapshot_at:
          type: string
          format: date-time
          description: >-
            The database instant the view was read at (UTC). Every count covers
            `[window_start, snapshot_at)`.
          examples:
            - '2026-10-17T12:00:00.123456Z'
        window_start:
          type: string
          format: date-time
          description: >-
            The start of the measured interval (UTC): `snapshot_at` minus the
            health window (30 days by default), or the start of the
            uninterrupted retained history when that is later. It equals
            `snapshot_at` when no history is retained, which is not evidence of
            successful delivery.
          examples:
            - '2026-09-17T12:00:00.123456Z'
        delivery_outcomes:
          type: object
          additionalProperties:
            type: integer
          description: >-
            Delivery-attempt outcome counts in `[window_start, snapshot_at)`
            (keyed by outcome, e.g. `delivered`, `failed`, `dead_lettered`).
            Always an object, never null.
          examples:
            - delivered: 7
              failed: 2
              dead_lettered: 1
        recent_outcomes:
          type: object
          additionalProperties:
            type: integer
          description: >-
            The same outcome histogram restricted to the last 24 hours, never
            before `window_start` (a subset of `delivery_outcomes`). Always an
            object; an outcome with no recent activity is simply a missing key.
          examples:
            - delivered: 3
              failed: 1
        success_rate:
          type:
            - number
            - 'null'
          description: >-
            The derived per-attempt delivery rate over the window (`delivered /
            (delivered + failed + dead_lettered)`), in `[0.0, 1.0]`. `null` when
            there are zero terminal attempts (distinct from a genuine `0.0`).
            Per-attempt, not per-job, and informational only — it does not
            change `status`.
          examples:
            - 0.7
        dead_lettered:
          type: integer
          description: >-
            The count of dead-lettered attempts in `[window_start,
            snapshot_at)`.
          examples:
            - 1
        poison_events:
          type: integer
          description: >-
            A best-effort count of quarantined (poison) events in
            `[window_start, snapshot_at)`, keyed on the untrusted captured
            tenant id; drives `dropped_tenant`.
          examples:
            - 3
        dropped_tenant:
          type: boolean
          description: True when quarantined tenant events were observed.
          examples:
            - true
        consumer_lag_ms:
          type: integer
          format: int64
          description: Always `0`.
          examples:
            - 0
        auto_disabled:
          type:
            - boolean
            - 'null'
          description: >-
            The auto-disable verdict: `null` when the subscription has no
            recorded attempts yet, `false` when a health row exists with no
            verdict, `true` when auto-disable has tripped (which drives `status:
            "Down"`).
          examples:
            - true
        disabled_reason:
          type: string
          description: >-
            A fixed, secret-free auto-disable verdict token
            (`sustained_failure_5d12h`). Omitted when empty.
          examples:
            - sustained_failure_5d12h
        last_success_at:
          type: string
          format: date-time
          description: >-
            The last successful delivery timestamp (RFC 3339). Omitted when
            none.
          examples:
            - '2026-06-01T12:00:00Z'
        last_failure_at:
          type: string
          format: date-time
          description: The last failed delivery timestamp (RFC 3339). Omitted when none.
          examples:
            - '2026-06-05T09:30:00Z'
      required:
        - subscription_id
        - enabled
        - verification_state
        - status
        - snapshot_at
        - window_start
        - delivery_outcomes
        - recent_outcomes
        - success_rate
        - dead_lettered
        - poison_events
        - dropped_tenant
        - consumer_lag_ms
        - auto_disabled
    VerificationState:
      type: string
      description: >-
        The subscription's position in the destination verification state
        machine. Only an `active` subscription is deliverable. A `pull`
        subscription is born `active` — it has no destination to probe. Every
        other kind is born `pending_verification` and reaches `active` on a
        successful probe: `POST /v1/subscriptions/{id}/ping` for a `webhook`,
        and `PUT /v1/subscriptions/{id}/credential` for any queue sink (`sqs`,
        `rabbitmq`, `eventbridge`). An `sqs` or `eventbridge` sink has a second
        path: register a delegated grant — which persists the coordinates and
        leaves this field unchanged — then call `POST
        /v1/subscriptions/{id}/verify`. An `active` subscription whose probe
        later fails becomes `degraded`. The same successful probe returns this
        field to `active`. This field is one half of deliverability: `enabled`
        is the other half, and both must hold. No probe changes `enabled` except
        `POST /v1/subscriptions/{id}/verify`, which on a probe success clears an
        auto-disable in the same transaction as the state move.
      enum:
        - pending_verification
        - active
        - degraded
    HealthStatus:
      type: string
      description: >-
        The rolled-up delivery-health verdict. `Down` means the subscription was
        auto-disabled by the system (the endpoint is judged broken); `Degraded`
        means a lesser impairment (a manual disable, dead-lettered attempts, or
        dropped tenant events); `Healthy` otherwise.
      enum:
        - Healthy
        - Degraded
        - Down
    Error:
      type: object
      description: >-
        RFC 9457 `application/problem+json` document. An error the hub raises
        carries `detail` and the stable `code` a client branches on; a request
        the framework rejects before the operation runs carries no `code`.
      properties:
        type:
          type: string
          format: uri
          description: >-
            A stable, versioned URI identifying the problem type
            (`https://errors.lerian.studio/v1/<code>`).
          examples:
            - https://errors.lerian.studio/v1/not_found
        title:
          type: string
          description: A short human-readable summary — the HTTP status text.
          examples:
            - Not Found
        status:
          type: integer
          description: The HTTP status code, mirrored in the body.
          examples:
            - 404
        detail:
          type: string
          description: A human explanation of this specific occurrence.
          examples:
            - subscription not found
        code:
          type: string
          description: >-
            The stable, low-cardinality, machine-readable token a client
            branches on (for example `not_found`, `unauthorized`,
            `idempotency_conflict`, `validation_error`). Absent when the
            framework rejects the request before the operation runs.
          examples:
            - not_found
        instance:
          type: string
          description: The trace id of the request, when the hub has one.
          examples:
            - 4bf92f3577b34da6a3ce929d0e0e4736
        errors:
          type: array
          description: >-
            When present, the entries name what was refused. On
            `unknown_event_type`, each entry names one refused event type and
            its schema major.
          items:
            type: object
            properties:
              location:
                type: string
                description: The refused field, with its position in a list.
                examples:
                  - event_types/2
              message:
                type: string
                description: Why the hub refused the value.
                examples:
                  - '"transaction.creatd" has no catalog entry at schema major 1'
      required:
        - title
        - status
  responses:
    Unauthorized:
      description: >-
        Authentication failed. `code` names the cause, for example `AUT-0006`
        (no token), `AUT-0007` (an expired, invalid, or malformed token), or
        `unauthorized` (no trusted tenant context).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        The caller is authenticated but is not allowed to make this request.
        `code` names the cause, for example `AUT-1020` (the credential does not
        have the permission; `detail` names the refused `resource:action`) or
        `forbidden`.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: >-
        The resource is absent, soft-deleted, or owned by another tenant — a
        uniform `code` of `not_found` (no existence oracle).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: >-
        The tenant's allowance for this route is spent. `code` is
        `rate_limited`. Wait `Retry-After` seconds, then retry. Each tenant has
        three allowances: one for the catalog and the subscription list, detail,
        endpoint, health, and setup-artifacts reads; one for `GET /v1/events`;
        and one for the two dashboard routes.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: >-
        An infrastructure fault. `code` is `internal_error` and `detail` is
        scrubbed to the static `"internal error"` (the cause is logged, never
        returned). On a mutation that requires `X-Idempotency`, `code` can
        instead be `idempotency_outcome_unrecorded`: the mutation may have
        committed, and its outcome was not recorded. Read the resource before
        you send anything again.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
    MeteredServiceUnavailable:
      description: >-
        The hub cannot serve the request now. Branch on `code`. `AUT-0033`:
        Access Manager did not decide the request. `rate_limiter_unavailable`:
        the hub cannot check the tenant's allowance.
        `delegated_party_unconfirmed`, on `GET /v1/events` only: the hub cannot
        yet confirm the delegated party of the subscription. `read_timeout`, on
        the dashboard reads and the delivery-health read only: the read ran out
        of its time budget. Each is a transient condition, not a denial or a
        quota. Wait the `Retry-After` seconds, then retry; `read_timeout`
        carries no `Retry-After`.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
    GatewayTimeout:
      description: >-
        Access Manager did not answer in time. `code` names the cause, for
        example `AUT-1021`. Retry the request.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        A bearer JWT issued by Access Manager. The `/v1` surface never reads a
        tenant from the body, path, or query. Machine callers obtain a token
        with the Access Manager client-credentials flow. The `/admin` surface
        authorizes against an operator scope and carries no tenant context.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.