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

# Get an operational metric

> Reads one allowlisted deterministic operational metric as an evidence contract (value, unit, asOf, filters), computed live over the workspace data. Requires analytics:read. An unknown metric name is a 400. Value metrics are redacted unless the key holds the value scope (none in v1).



## OpenAPI

````yaml /openapi.en.json get /v1/analytics/metrics/{metric}
openapi: 3.1.0
info:
  description: >-
    The Muveya public developer API: opaque-API-key-authenticated,
    tenant-scoped, read-only /v1 resources. One rate-limit budget per key.
  title: Muveya Developer API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.muveya.com
security: []
tags:
  - name: API key
  - name: Clinics
  - name: Warehouses
  - name: Catalog
  - name: Inventory
  - name: Orders
  - name: Fulfillments
  - name: Analytics
paths:
  /v1/analytics/metrics/{metric}:
    get:
      tags:
        - Analytics
      summary: Get an operational metric
      description: >-
        Reads one allowlisted deterministic operational metric as an evidence
        contract (value, unit, asOf, filters), computed live over the workspace
        data. Requires analytics:read. An unknown metric name is a 400. Value
        metrics are redacted unless the key holds the value scope (none in v1).
      operationId: getAnalyticsMetric
      parameters:
        - name: metric
          in: path
          required: true
          description: The allowlisted metric key.
          schema:
            type: string
            enum:
              - LOW_STOCK
              - EXPIRING_STOCK
              - DELIVERY_EXCEPTIONS
              - RECEIPT_DISCREPANCIES
              - PENDING_ORDERS
              - BOX_TRACEABILITY
              - APPROVAL_DECISION_MEDIAN_HOURS
              - DISTINCT_CUSTODY_ACTORS
        - name: catalogItemId
          in: query
          required: false
          description: >-
            Narrows the stock metrics (LOW_STOCK, EXPIRING_STOCK) to one catalog
            item.
          schema:
            type: string
        - name: from
          in: query
          required: false
          description: >-
            Inclusive ISO-8601 start of the window for
            APPROVAL_DECISION_MEDIAN_HOURS (by submission) and
            DISTINCT_CUSTODY_ACTORS (by receipt).
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          required: false
          description: Exclusive ISO-8601 end of that window.
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: The requested metric.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SemanticMetric'
          headers:
            X-RateLimit-Limit:
              description: The per-key request budget for the current window.
              schema:
                type: integer
                minimum: 1
            X-RateLimit-Remaining:
              description: Requests left in the current window (0 when exhausted).
              schema:
                type: integer
                minimum: 0
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
                minimum: 1
            RateLimit:
              description: >-
                IETF draft budget snapshot, e.g. "limit=120, remaining=119,
                reset=60".
              schema:
                type: string
            RateLimit-Policy:
              description: IETF draft policy, e.g. "120;w=60" (limit;window-seconds).
              schema:
                type: string
        '400':
          description: The metric name is not a known metric.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          headers:
            X-RateLimit-Limit:
              description: The per-key request budget for the current window.
              schema:
                type: integer
                minimum: 1
            X-RateLimit-Remaining:
              description: Requests left in the current window (0 when exhausted).
              schema:
                type: integer
                minimum: 0
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
                minimum: 1
            RateLimit:
              description: >-
                IETF draft budget snapshot, e.g. "limit=120, remaining=119,
                reset=60".
              schema:
                type: string
            RateLimit-Policy:
              description: IETF draft policy, e.g. "120;w=60" (limit;window-seconds).
              schema:
                type: string
        '401':
          description: >-
            The API key is missing, invalid, revoked, expired, or bound to a
            suspended workspace.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: The API key lacks the scope this route requires.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: The API key exceeded its rate limit for the current window.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          headers:
            Retry-After:
              description: Positive delta-seconds until another request is allowed.
              schema:
                type: integer
                minimum: 1
            X-RateLimit-Limit:
              description: The per-key request budget for the current window.
              schema:
                type: integer
                minimum: 1
            X-RateLimit-Remaining:
              description: Requests left in the current window (0 when exhausted).
              schema:
                type: integer
                minimum: 0
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
                minimum: 1
            RateLimit:
              description: >-
                IETF draft budget snapshot, e.g. "limit=120, remaining=119,
                reset=60".
              schema:
                type: string
            RateLimit-Policy:
              description: IETF draft policy, e.g. "120;w=60" (limit;window-seconds).
              schema:
                type: string
      security:
        - apiKeyBearer: []
components:
  schemas:
    SemanticMetric:
      type: object
      additionalProperties: false
      required:
        - metric
        - value
        - unit
        - timezone
        - asOf
        - freshness
        - evidenceId
        - truncated
        - filters
      properties:
        metric:
          type: string
          enum:
            - LOW_STOCK
            - EXPIRING_STOCK
            - DELIVERY_EXCEPTIONS
            - RECEIPT_DISCREPANCIES
            - PENDING_ORDERS
            - BOX_TRACEABILITY
            - APPROVAL_DECISION_MEDIAN_HOURS
            - DISTINCT_CUSTODY_ACTORS
        value:
          type:
            - number
            - 'null'
          description: >-
            The figure; null when a percentage or median has no sample, never
            zero.
        unit:
          type: string
          description: 'The value''s unit: count, percent or hours.'
        definition:
          type: string
          description: What the figure measures, in words.
        numerator:
          type: integer
          description: What a percentage counts.
        denominator:
          type: integer
          description: What a percentage divides by.
        sampleCount:
          type: integer
          description: How many observations the figure stands on.
        caveats:
          type: array
          items:
            type: string
          description: >-
            Machine-readable limits of the figure, e.g.
            wall_clock_hours_no_business_calendar.
        timezone:
          type: string
        asOf:
          type: string
          format: date-time
          description: When the metric was computed.
        freshness:
          type: string
          enum:
            - live
        evidenceId:
          type: string
          description: >-
            A stable descriptor of the metric and its filters, for
            drill-down/citation.
        truncated:
          type: boolean
          description: 'True when a bounded scan hit its cap: the value is a lower bound.'
        filters:
          type: object
          additionalProperties:
            type: string
        currency:
          type: string
        period:
          type: object
          additionalProperties: false
          required:
            - from
            - to
          properties:
            from:
              type: string
            to:
              type: string
    ProblemDetails:
      type: object
      additionalProperties: false
      required:
        - type
        - title
        - status
        - detail
        - instance
        - code
        - requestId
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
          minimum: 400
          maximum: 599
        detail:
          type: string
        instance:
          type: string
        code:
          type: string
        requestId:
          type: string
  securitySchemes:
    apiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: >-
        Opaque mvy_test_ API key sent as a Bearer token. It derives exactly one
        workspace server-side; the path never carries a workspace selector.

````

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