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

# Get Team Metrics

> Returns monthly financial and usage metrics for a team, including invoiced amounts, bookings, and check-in time.

# Get Team Metrics

Returns an array of monthly metric snapshots for a team. Each entry covers one calendar month and includes invoiced amounts, booking and check-in minutes, revenue, and outstanding charges. Used on the team dashboard to render trend charts.

## Authentication

Requires a valid customer bearer token. The customer must be a team administrator of the specified team.

## Path Parameters

<ParamField path="teamId" type="number" required>
  Numeric identifier of the team. Returned as `Id` from [`GET /api/public/teams/my`](/api/endpoints/teams/list-teams).
</ParamField>

## Query Parameters

<ParamField query="_shape" type="string">
  Comma-separated list of field paths to include in the response. When provided, only the
  specified fields are returned — useful for reducing payload size. Supports nested paths
  using dot notation.
</ParamField>

## Response

<ResponseField name="Metrics" type="TeamMetric[]" required>
  Array of monthly metric snapshots, ordered chronologically.
</ResponseField>

### Per-Month Fields

<ResponseField name="Metrics[].Id" type="number">
  Unique identifier for the metric record.
</ResponseField>

<ResponseField name="Metrics[].MonthDate" type="string">
  ISO 8601 date representing the first day of the month this record covers.
</ResponseField>

<ResponseField name="Metrics[].CurrencyCode" type="string">
  ISO 4217 currency code for all monetary values in this record.
</ResponseField>

<ResponseField name="Metrics[].InvoicedAmount" type="number">
  Total invoiced amount for the member in this month.
</ResponseField>

<ResponseField name="Metrics[].TeamInvoicedAmount" type="number">
  Total invoiced amount across the entire team in this month.
</ResponseField>

<ResponseField name="Metrics[].Revenue" type="number">
  Total revenue for the team in this month.
</ResponseField>

<ResponseField name="Metrics[].CheckingMinutes" type="number">
  Member's checked-in time in minutes.
</ResponseField>

<ResponseField name="Metrics[].TeamCheckingMinutes" type="number">
  Total team checked-in time in minutes.
</ResponseField>

<ResponseField name="Metrics[].BookingMinutes" type="number">
  Member's booked time in minutes.
</ResponseField>

<ResponseField name="Metrics[].TeamBookingMinutes" type="number">
  Total team booked time in minutes.
</ResponseField>

<ResponseField name="Metrics[].TotalBookings" type="number">
  Total number of bookings.
</ResponseField>

<ResponseField name="Metrics[].TotalTariffs" type="number">
  Total number of active membership plans.
</ResponseField>

<ResponseField name="Metrics[].TotalOther" type="number">
  Total other charges.
</ResponseField>

<ResponseField name="Metrics[].TimePasses" type="number">
  Number of time passes used.
</ResponseField>

<ResponseField name="Metrics[].Bookings" type="number">
  Revenue from bookings.
</ResponseField>

<ResponseField name="Metrics[].TotalUnpaid" type="number">
  Total unpaid amount.
</ResponseField>

<ResponseField name="Metrics[].TotalUnpaidNexKiosk" type="number">
  Total unpaid NexKiosk charges.
</ResponseField>

<ResponseField name="Metrics[].TotalDue" type="number">
  Total amount currently due.
</ResponseField>

<ResponseField name="Metrics[].UnPaidAttendees" type="number">
  Unpaid event attendee charges.
</ResponseField>

<ResponseField name="Metrics[].NotInvoicedCharges" type="number">
  Total charges not yet invoiced.
</ResponseField>

<ResponseField name="Metrics[].UnInvoicedCharges" type="number">
  Uninvoiced miscellaneous charges.
</ResponseField>

<ResponseField name="Metrics[].UnInvoicedProducts" type="number">
  Uninvoiced product charges.
</ResponseField>

<ResponseField name="Metrics[].UnInvoicedTimePasses" type="number">
  Uninvoiced time pass charges.
</ResponseField>

<ResponseField name="Metrics[].UnInvoicedExtraServices" type="number">
  Uninvoiced extra service charges.
</ResponseField>

<ResponseField name="Metrics[].NextInvoice" type="string | null">
  ISO 8601 datetime of the next scheduled invoice, or `null` if none is scheduled.
</ResponseField>

<ResponseField name="Metrics[].DasySinceLastAccess" type="number">
  Days since the member's last portal access. Note the typo (`Dasy`) — it is preserved as-is in the API.
</ResponseField>

## Examples

### Fetch team metrics

```http theme={null}
GET /api/public/teams/55/metrics
Authorization: Bearer {token}
```

```json theme={null}
{
  "Metrics": [
    {
      "Id": 1001,
      "MonthDate": "2025-01-01T00:00:00",
      "CurrencyCode": "GBP",
      "InvoicedAmount": 1250.0,
      "TeamInvoicedAmount": 8500.0,
      "Revenue": 8500.0,
      "CheckingMinutes": 2400,
      "TeamCheckingMinutes": 18000,
      "BookingMinutes": 480,
      "TeamBookingMinutes": 3200,
      "TotalBookings": 15,
      "TotalTariffs": 12,
      "TotalOther": 0,
      "TimePasses": 3,
      "Bookings": 450.0,
      "TotalUnpaid": 200.0,
      "TotalUnpaidNexKiosk": 0,
      "TotalDue": 200.0,
      "UnPaidAttendees": 0,
      "NotInvoicedCharges": 50.0,
      "UnInvoicedCharges": 25.0,
      "UnInvoicedProducts": 15.0,
      "UnInvoicedTimePasses": 10.0,
      "UnInvoicedExtraServices": 0,
      "NextInvoice": "2025-02-01T00:00:00",
      "DasySinceLastAccess": 2
    }
  ]
}
```

## TypeScript Integration

```typescript theme={null}
import { endpoints } from '@/api/endpoints'
import { TeamMetrics } from '@/types/endpoints/TeamMetrics'
import { useData } from '@/hooks/useData'

const { resource: metricsData } = useData<TeamMetrics>(httpClient, endpoints.teams.metrics(teamId))
```

## Usage in Portal

| Context                                                     | Source file                                                        |
| ----------------------------------------------------------- | ------------------------------------------------------------------ |
| Team dashboard metrics section (`/dashboard/team/{teamId}`) | `src/views/user/dashboards/team/components/TeamMetricsSection.tsx` |

## Error Responses

<ResponseField name="401 Unauthorized" type="error">
  The customer is not authenticated or the session has expired.
</ResponseField>

<ResponseField name="404 Not Found" type="error">
  Team with the specified ID does not exist.
</ResponseField>

## Related Endpoints

| Method | Endpoint                                | Description               |
| ------ | --------------------------------------- | ------------------------- |
| `GET`  | `/api/public/teams/{teamId}/kpi`        | Per-member KPI data       |
| `GET`  | `/api/public/teams/{teamId}/attendance` | Team attendance data      |
| `GET`  | `/api/public/teams/{teamId}/profile`    | Full team profile         |
| `GET`  | `/api/public/teams/my`                  | List the customer's teams |
