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

# Get top customers by spend

> Returns the organization’s highest-spending customers (descending by total spent) along with the total customer count. Spend amounts are serialised as strings (bigint). Requires a Nevermined API key. Requires active organization membership. Requires the organization to be on the Premium tier or higher.



## OpenAPI

````yaml /api-reference/organizations-openapi.json get /organizations/{orgId}/analytics/customers
openapi: 3.0.0
info:
  title: Nevermined Organizations API
  description: >-
    Manage a Nevermined organization programmatically — members, tiers, groups &
    budgets, treasury wallets, customers, webhooks, analytics, and
    agent-discovery surfaces.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.sandbox.nevermined.app/api/v1
    description: Sandbox
  - url: https://api.live.nevermined.app/api/v1
    description: Live
security: []
tags:
  - name: Organizations
    x-group: General
    description: Organization settings, members & roles, and workspace context.
  - name: Organizations - Billing
    x-group: Billing
    description: Tiers, subscriptions, invoices, checkout, and the public tier catalog.
  - name: Groups
    x-group: Groups & Budgets
    description: Organization groups, per-group budgets, and shared payment methods.
  - name: Organizations - Wallets
    x-group: Wallets
    description: Custodial stablecoin treasury wallets.
  - name: Organizations - Customers
    x-group: Customers
    description: The white-label customer CRM (Enterprise).
  - name: Organizations - Analytics
    x-group: Analytics
    description: Revenue, MRR, usage, conversion, and per-member metrics.
  - name: Organizations - Webhooks
    x-group: Webhooks
    description: Outbound webhook subscriptions and deliveries.
  - name: Organizations - Activity
    x-group: Activity
    description: The organization activity feed.
  - name: Organizations - Realtime
    x-group: Realtime
    description: Realtime WebSocket secret management (Enterprise).
  - name: Invitations
    x-group: Invitations
    description: Invite people to an organization.
  - name: Organizations - Integration
    x-group: Agent Discovery
    description: >-
      Public agent-discovery surfaces (llms.txt, agentic-instructions.md,
      ai-catalog.json).
paths:
  /organizations/{orgId}/analytics/customers:
    get:
      tags:
        - Organizations - Analytics
      summary: Get top customers by spend
      description: >-
        Returns the organization’s highest-spending customers (descending by
        total spent) along with the total customer count. Spend amounts are
        serialised as strings (bigint). Requires a Nevermined API key. Requires
        active organization membership. Requires the organization to be on the
        Premium tier or higher.
      operationId: OrganizationAnalyticsController_topCustomers
      parameters:
        - name: orgId
          required: true
          in: path
          description: Organization ID
          schema:
            type: string
            example: org-abc123
        - name: limit
          required: false
          in: query
          description: Maximum number of top customers to return (1–200).
          schema:
            example: 10
            type: number
      responses:
        '200':
          description: Top customers and total count
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopCustomersResponseDto'
        '401':
          description: Missing or invalid Nevermined API key
        '403':
          description: >-
            Caller is not an organization member, or the org is not on the
            Premium tier or higher
      security:
        - Authorization: []
components:
  schemas:
    TopCustomersResponseDto:
      type: object
      properties:
        items:
          description: Top customers ordered by spend DESC.
          type: array
          items:
            $ref: '#/components/schemas/TopCustomerItemDto'
        totalCustomers:
          type: number
          description: Total number of customers in the organization.
          example: 1342
      required:
        - items
        - totalCustomers
    TopCustomerItemDto:
      type: object
      properties:
        customerId:
          type: string
          description: Customer record ID.
          example: oc-7b1c3e9a
        userId:
          type: string
          description: Nevermined user ID of the customer.
          example: us-2f4a6c8e
        totalSpent:
          type: string
          description: >-
            Total amount the customer has spent, serialised as a string
            (bigint).
          example: '125000000'
        firstSeenAt:
          type: string
          description: ISO-8601 timestamp the customer was first observed.
          example: '2026-01-15T09:30:00.000Z'
        lastActiveAt:
          type: string
          description: ISO-8601 timestamp of the customer’s most recent activity.
          example: '2026-05-20T14:05:00.000Z'
      required:
        - customerId
        - userId
        - totalSpent
        - firstSeenAt
        - lastActiveAt
  securitySchemes:
    Authorization:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

## Related topics

- [Customers](/docs/solutions/organizations/customers.md)
- [Organizations](/docs/solutions/organizations/overview.md)
- [Automatic Credit Top-Ups](/docs/integrate/patterns/top-up.md)
- [White-label Customer Onboarding](/docs/solutions/organizations/white-label-onboarding.md)
- [Org-wide customer aggregations](/docs/api-reference/organizations--customers/org-wide-customer-aggregations.md)
