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

# Get dashboard statistics

> Returns the aggregated counters rendered on the brand dashboard home (total products, completeness average, active/broken offers, expiring certifications, products missing images). Counts are computed live against the requesting organization — there is no caching layer. Caller must be a member of ``organization_id`` or a 404 is returned.



## OpenAPI

````yaml /openapi/openapi-dashboard.json get /dashboard/api/v1/stats/{organization_id}
openapi: 3.1.0
info:
  title: Brand Dashboard API (Internal)
  version: 1.0.0
  description: >
    Internal endpoints powering the brand dashboard UI. Not intended for
    external integrations — use the Products, Brands, and other public APIs
    instead.


    ## Authentication


    All endpoints require an API key passed via the `X-API-Key` HTTP header,
    unless otherwise noted.


    ```

    X-API-Key: csb_<body>_<checksum>

    ```


    Generate API keys in **Settings > API Keys** in your dashboard, or via the
    Account API.

    Session-based (cookie) authentication is also accepted for browser-based
    access.


    ## Rate Limits


    | Tier        | Requests / minute | Requests / day |

    |-------------|-------------------|----------------|

    | Default     | 300               | 10,000         |

    | Custom      | Contact us        | Contact us     |


    Rate-limit headers are included on every response so callers can
    self-throttle without

    hitting our 429s ("informed governor"):


    - `RateLimit-Policy` — every active window, e.g. `300;w=60, 10000;w=86400`

    - `RateLimit-Limit` — quota for the **most-restrictive** currently-active
    window

    - `RateLimit-Remaining` — requests left in that window

    - `RateLimit-Reset` — seconds until that window resets (relative; clock-skew
    safe)


    Legacy `X-RateLimit-*` aliases are also emitted for back-compat.
    `X-RateLimit-Reset`

    keeps the absolute Unix-timestamp shape to avoid breaking existing
    consumers.


    When rate-limited, you receive `429 Too Many Requests` with a
    `retry_after_seconds` field

    in the error envelope and a `Retry-After` header.


    ## Pagination


    List endpoints return paginated results in this envelope:


    ```json

    {
      "data": [...],
      "pagination": {
        "page": 1,
        "page_size": 25,
        "total_count": 342,
        "total_pages": 14,
        "has_next": true,
        "has_previous": false
      }
    }

    ```


    Use `?page=2&page_size=50` query parameters. Maximum page size is 100.


    ## Error Responses


    All errors conform to [RFC 9457 Problem
    Details](https://www.rfc-editor.org/rfc/rfc9457)

    with `Content-Type: application/problem+json`:


    ```json

    {
      "type": "https://closient.com/docs/errors/not_found",
      "title": "Not Found",
      "status": 404,
      "detail": "The requested resource was not found.",
      "error_code": "not_found",
      "retryable": false,
      "timestamp": "2026-03-31T12:00:00+00:00"
    }

    ```


    Common error codes: `unauthorized` (401), `forbidden` (403), `not_found`
    (404),

    `validation_error` (422), `rate_limited` (429), `internal_error` (500).
  termsOfService: https://www.closient.com/terms/
servers:
  - url: https://www.closient.com
security: []
externalDocs:
  description: Closient Documentation
  url: https://docs.closient.com
paths:
  /dashboard/api/v1/stats/{organization_id}:
    get:
      tags:
        - Stats
      summary: Get dashboard statistics
      description: >-
        Returns the aggregated counters rendered on the brand dashboard home
        (total products, completeness average, active/broken offers, expiring
        certifications, products missing images). Counts are computed live
        against the requesting organization — there is no caching layer. Caller
        must be a member of ``organization_id`` or a 404 is returned.
      operationId: apps_dashboard_api_stats_dashboard_stats
      parameters:
        - in: path
          name: organization_id
          schema:
            description: UUID of the organization to summarize.
            format: shortuuid
            maxLength: 22
            minLength: 22
            pattern: ^[23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{22}$
            title: Organization Id
            type: string
          required: true
          description: UUID of the organization to summarize.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardStatsOut'
      security:
        - APIKeyHeaderAuth: []
        - OAuthTokenAuth: []
        - SessionAuth: []
components:
  schemas:
    DashboardStatsOut:
      description: Aggregated metrics rendered on the brand dashboard home page.
      examples:
        - active_offers: 45
          avg_completeness: 78
          broken_offers: 3
          complete_products: 980
          expiring_certifications: 12
          missing_images: 87
          total_products: 1250
      properties:
        total_products:
          description: Count of every product owned by the organization (any status).
          examples:
            - 1250
          minimum: 0
          title: Total Products
          type: integer
        complete_products:
          description: >-
            Count of products whose completeness score is 80 or higher. Uses the
            same scoring as ``GET /trade-items/{org}/{gtin}/completeness``.
          examples:
            - 980
          minimum: 0
          title: Complete Products
          type: integer
        avg_completeness:
          description: >-
            Average completeness percentage across every product (0-100, rounded
            to the nearest integer). 0 when the org has no products.
          examples:
            - 78
          maximum: 100
          minimum: 0
          title: Avg Completeness
          type: integer
        active_offers:
          description: >-
            Total active offers across both in-store and online channels for
            this organization. Counts only offers with ``status='active'``.
          examples:
            - 45
          minimum: 0
          title: Active Offers
          type: integer
        broken_offers:
          description: >-
            Online offers whose URL check is currently failing (``url_status``
            in ``broken``, ``timeout``, ``dns_failure``). Brand managers triage
            these on the dashboard home.
          examples:
            - 3
          minimum: 0
          title: Broken Offers
          type: integer
        expiring_certifications:
          description: >-
            Certification assignments whose ``expiry_date`` falls in the next 60
            days but is still in the future. Excludes already-expired certs.
          examples:
            - 12
          minimum: 0
          title: Expiring Certifications
          type: integer
        missing_images:
          description: >-
            Distinct products owned by the organization that have zero
            ``ProductImage`` rows attached.
          examples:
            - 87
          minimum: 0
          title: Missing Images
          type: integer
      required:
        - total_products
        - complete_products
        - avg_completeness
        - active_offers
        - broken_offers
        - expiring_certifications
        - missing_images
      title: DashboardStatsOut
      type: object
  securitySchemes:
    APIKeyHeaderAuth:
      type: apiKey
      in: header
      name: X-API-Key
    OAuthTokenAuth:
      type: http
      scheme: bearer
    SessionAuth:
      type: apiKey
      in: cookie
      name: sessionid

````