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

# Get analysis queue statistics

> Returns the organization's analysis queue: items per status,
throughput over the last hour, estimated time to drain, and a health
status. `health` is `backlogged` above 100,000 pending items, `busy`
above 10,000, `degraded` when more than 10 items failed in the last
hour, and `healthy` otherwise.

Requires `ai-insights-v2:queue` (`read`). Rate limit: 100 requests
per minute.




## OpenAPI

````yaml /api-reference/ai-insights-v2/swagger.yml get /v1/analytics/queue-stats
openapi: 3.0.3
info:
  version: 1.0.0
  title: AI Insights API
  description: |
    Public REST API for the Prisme.ai AI Insights workspace - analyzed
    conversations, analysis triggering and status, evaluation criteria,
    message feedback, organization analytics, LLM consumption, memory
    analytics, and the agent relationship graph.

    **Organization scope.** Every endpoint reads and writes the data of the
    caller's organization, taken from the session (or from the org API key).
    No parameter lets a caller target another organization.

    **Permissions.** Each endpoint checks an organization IAM permission
    `ai-insights-v2:<resource>` with the action `read` or `write`
    (`manage` grants both). The resources are `conversations`, `feedback`,
    `analytics`, and `queue`; each operation states the one it requires.
    Platform admins and workspace admins are always allowed.

    **Rate limits.** Limits are counted per caller (user, or org API key)
    and per endpoint, over a sliding window. Depending on the endpoint, an
    exceeded limit returns one of two 429 bodies; both are documented on
    each operation.
  contact:
    name: Prisme.ai
    url: https://prisme.ai
servers:
  - url: https://{host}/v2/workspaces/slug:ai-insights-v2/webhooks
    description: Prisme.ai workspace webhooks
    variables:
      host:
        default: api.studio.prisme.ai
        description: API host (override for self-hosted or sandbox)
security:
  - BearerAuth: []
  - OrgApiKeyAuth: []
tags:
  - name: Insights
    description: Per-conversation analysis results and analysis status.
  - name: Agents
    description: >-
      Analysis triggering, evaluation criteria, conversations, and users of one
      agent.
  - name: Feedback
    description: Like / dislike feedback on agent messages.
  - name: Analytics
    description: Organization-wide usage, quality, latency, and adoption metrics.
  - name: Consumption
    description: LLM requests, tokens, cost, and carbon footprint, per user and over time.
  - name: Queue
    description: State of the conversation analysis queue.
  - name: Memories
    description: Analytics built from the memories users accumulate with agents.
  - name: Graph
    description: >-
      Agent relationship graph - tools, categories, delegations, similarity, and
      clusters.
paths:
  /v1/analytics/queue-stats:
    get:
      tags:
        - Queue
      summary: Get analysis queue statistics
      description: |
        Returns the organization's analysis queue: items per status,
        throughput over the last hour, estimated time to drain, and a health
        status. `health` is `backlogged` above 100,000 pending items, `busy`
        above 10,000, `degraded` when more than 10 items failed in the last
        hour, and `healthy` otherwise.

        Requires `ai-insights-v2:queue` (`read`). Rate limit: 100 requests
        per minute.
      operationId: getQueueStats
      responses:
        '200':
          description: Queue statistics.
          content:
            application/json:
              schema:
                type: object
                properties:
                  queue_depth:
                    type: integer
                    description: Pending items.
                  processing:
                    type: integer
                  completed_total:
                    type: integer
                  failed_total:
                    type: integer
                  throughput:
                    type: object
                    properties:
                      completed_per_hour:
                        type: integer
                      failed_per_hour:
                        type: integer
                  estimated_completion_hours:
                    type: integer
                    description: >-
                      Hours to drain the pending items at the current rate, or
                      `-1` when nothing completed in the last hour.
                  health:
                    type: string
                    enum:
                      - healthy
                      - busy
                      - backlogged
                      - degraded
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  responses:
    Unauthenticated:
      description: Missing or invalid credentials, or no organization context.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: UNAUTHORIZED
            message: Authentication required
    Forbidden:
      description: The caller lacks the permission required by the endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: FORBIDDEN
            message: 'Access denied: missing permission ''ai-insights-v2:analytics:read'''
    TooManyRequests:
      description: >-
        Rate limit exceeded. Retry after the number of seconds given in the
        `Retry-After` header.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RuntimeError'
          example:
            error: TooManyRequests
            message: Too many requests for 'Insights'
            details:
              name: Insights
              ok: false
              retryAfter: 42.5
              limit: 100
              window: 60
              remaining: 0
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            Error code (e.g. `FORBIDDEN`), or error message on some validation
            errors.
        message:
          type: string
          description: Human-readable message.
    RuntimeError:
      type: object
      description: Error raised by the Prisme.ai runtime before the endpoint logic runs.
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        User-bound credential carrying an identity: either a session JWT
        or a user access token (`at:*`) generated from the user settings UI.
        Send as `Authorization: Bearer <token>`. The organization and the
        permissions applied are those of this user.
    OrgApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key
      description: |
        Organization API key (`iak_{orgSlug}_{uuid}`), managed from the
        AI Governance UI. It is not tied to a user: its access is defined by
        the permissions attached to it, and all keys of an organization share
        the same rate-limit counters. Endpoints that describe "your own"
        data, such as `GET /v1/users/{user_id}`, need a user credential.
        Send as `x-prismeai-api-key: iak_...`.

````

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