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

# Inventory health

> Lot health snapshot: aging, mix, heavy models, merchandising gaps

Returns a public-safe used-car desk snapshot of the lot: aging buckets (retail value only), new/used/CPO mix, heavy or overstocked model groups, and merchandising gaps (missing photos or Hrizn AI descriptions).

**Scope required:** `inventory:read`

Aging is computed from `instock_date` (days in stock). Analysis is capped (currently 2,000 units); `truncated` is true when the lot is larger.

Dealer **cost is never included**.

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "data": {
      "total_units": 312,
      "analyzed": 312,
      "truncated": false,
      "mix": { "new": 140, "used": 150, "cpo": 22 },
      "pricing": {
        "avg_price": 28450,
        "median_price": 26990,
        "value_tied_up_retail": 8876400
      },
      "aging": [
        { "label": "0-30 days", "count": 120, "value_tied_up_retail": 3200000 },
        { "label": "31-60 days", "count": 90, "value_tied_up_retail": 2500000 },
        { "label": "61-90 days", "count": 60, "value_tied_up_retail": 1800000 },
        { "label": "90+ days", "count": 42, "value_tied_up_retail": 1376400 }
      ],
      "aged_units_90_plus": 42,
      "heavy_models": [
        {
          "label": "Toyota Camry",
          "count": 18,
          "avg_days_on_lot": 47,
          "avg_price": 27990,
          "aged_units": 4
        }
      ],
      "merchandising": {
        "missing_photos": 8,
        "thin_photos": 21,
        "missing_description": 54
      }
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /inventory/health
openapi: 3.1.0
info:
  title: Hrizn Public API
  version: 1.2.0
  description: >
    The Hrizn Public API allows partners to programmatically create content,
    manage inventory descriptions, and integrate with the Hrizn platform.


    All endpoints are prefixed with `/public` and require an API key passed via
    the `X-API-Key` header (except the health check).
  contact:
    email: support@hrizn.io
servers:
  - url: https://api.app.hrizn.io/v1/public
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: IdeaClouds
    description: Create and manage AI-powered keyword research
  - name: Content Intelligence
    description: AI-powered content gap analysis and recommendations
  - name: Content
    description: Generate content from IdeaClouds
  - name: Compliance
    description: Run OEM compliance checks on content
  - name: Content Tools
    description: Generate SEO metadata, schemas, and social snippets
  - name: Inventory
    description: Access vehicle data and AI descriptions
  - name: Market
    description: >-
      Live local market listings, days supply, competitive set, and pricing
      insights (Unlimited plan + market_data:read)
  - name: Site
    description: View dealership details and configuration
  - name: Webhooks
    description: Manage webhook subscriptions for real-time events
  - name: Reference
    description: Look up available types, scopes, and events
  - name: Social
    description: >-
      Social Hub posting and reviews across all connected platforms (X,
      Facebook, Instagram, LinkedIn, Google Business Profile)
  - name: Health
    description: Health check (no authentication)
paths:
  /inventory/health:
    get:
      tags:
        - Inventory
      summary: Get inventory health
      description: >
        Public-safe lot health snapshot (aging buckets with retail value only,
        mix, heavy models, merchandising gaps). Never includes dealer cost.
      operationId: getInventoryHealth
      responses:
        '200':
          description: Inventory health snapshot
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InventoryHealthResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    InventoryHealthResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            total_units:
              type: integer
            analyzed:
              type: integer
            truncated:
              type: boolean
            mix:
              type: object
              properties:
                new:
                  type: integer
                used:
                  type: integer
                cpo:
                  type: integer
            pricing:
              type: object
              properties:
                avg_price:
                  type: number
                  nullable: true
                median_price:
                  type: number
                  nullable: true
                value_tied_up_retail:
                  type: number
            aging:
              type: array
              items:
                type: object
                properties:
                  label:
                    type: string
                  count:
                    type: integer
                  value_tied_up_retail:
                    type: number
            aged_units_90_plus:
              type: integer
            heavy_models:
              type: array
              items:
                type: object
            merchandising:
              type: object
              properties:
                missing_photos:
                  type: integer
                thin_photos:
                  type: integer
                missing_description:
                  type: integer
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: validation_error
            message:
              type: string
              example: 'keyword: Required'
            details:
              type: object
            request_id:
              type: string
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: API key lacks required scope
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your Hrizn API key (prefix hzk_)

````