> ## 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 KPIs

> Returns per-member KPI data for a team, including uninvoiced charges, remaining credits, and usage totals.

# Get Team KPIs

Returns key performance indicators for every member of a team. Each entry includes uninvoiced charges, remaining booking and time credits, and total/monthly usage. Used on the team dashboard to give administrators a quick financial and usage overview.

## 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="Kpi" type="TeamKpi[]" required>
  Array of per-member KPI objects.
</ResponseField>

### Per-Member Fields

<ResponseField name="Kpi[].CoworkerId" type="number">
  Numeric identifier of the team member.
</ResponseField>

<ResponseField name="Kpi[].CoworkerFullName" type="string">
  Display name of the team member.
</ResponseField>

<ResponseField name="Kpi[].CoworkerEmail" type="string">
  Email address of the team member.
</ResponseField>

<ResponseField name="Kpi[].UninvoicedProducts" type="number">
  Count of purchased products not yet invoiced.
</ResponseField>

<ResponseField name="Kpi[].UninvoicedExtraServices" type="number">
  Count of extra services not yet invoiced.
</ResponseField>

<ResponseField name="Kpi[].UnivoicedEventAttendees" type="number">
  Count of event attendee charges not yet invoiced. Note the typo (`Univoiced`) — it is preserved as-is in the API.
</ResponseField>

<ResponseField name="Kpi[].UnivoicedTimepasses" type="number">
  Count of time passes not yet invoiced. Note the typo (`Univoiced`) — it is preserved as-is in the API.
</ResponseField>

<ResponseField name="Kpi[].RemainingBookingCredit" type="number">
  Remaining booking credit balance.
</ResponseField>

<ResponseField name="Kpi[].RemainingTimeCreditMinutes" type="number">
  Remaining time credit in minutes.
</ResponseField>

<ResponseField name="Kpi[].RemainingTimeCreditDays" type="number">
  Remaining time credit in days.
</ResponseField>

<ResponseField name="Kpi[].RemainingTimeCreditWeeks" type="number">
  Remaining time credit in weeks.
</ResponseField>

<ResponseField name="Kpi[].RemainingTimeCreditMonths" type="number">
  Remaining time credit in months.
</ResponseField>

<ResponseField name="Kpi[].RemainingTimeCreditUses" type="number">
  Remaining time credit uses.
</ResponseField>

<ResponseField name="Kpi[].RemainingTimePassesMinutes" type="number">
  Remaining time pass minutes.
</ResponseField>

<ResponseField name="Kpi[].RemainingTimePassesCount" type="number">
  Remaining time pass count.
</ResponseField>

<ResponseField name="Kpi[].BookedTimeTotal" type="number">
  Total booked time in minutes across all time.
</ResponseField>

<ResponseField name="Kpi[].BookedTimeThisMonth" type="number">
  Total booked time in minutes for the current month.
</ResponseField>

<ResponseField name="Kpi[].CheckedTimeTotal" type="number">
  Total checked-in time in minutes across all time.
</ResponseField>

<ResponseField name="Kpi[].CheckedTimeThisMonth" type="number">
  Total checked-in time in minutes for the current month.
</ResponseField>

## Examples

### Fetch team KPIs

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

```json theme={null}
{
  "Kpi": [
    {
      "CoworkerId": 101,
      "CoworkerFullName": "Jane Smith",
      "CoworkerEmail": "jane@techinnovators.com",
      "UninvoicedProducts": 2,
      "UninvoicedExtraServices": 0,
      "UnivoicedEventAttendees": 1,
      "UnivoicedTimepasses": 0,
      "RemainingBookingCredit": 500,
      "RemainingTimeCreditMinutes": 120,
      "RemainingTimeCreditDays": 0,
      "RemainingTimeCreditWeeks": 0,
      "RemainingTimeCreditMonths": 0,
      "RemainingTimeCreditUses": 5,
      "RemainingTimePassesMinutes": 60,
      "RemainingTimePassesCount": 1,
      "BookedTimeTotal": 4200,
      "BookedTimeThisMonth": 360,
      "CheckedTimeTotal": 3800,
      "CheckedTimeThisMonth": 300
    }
  ]
}
```

## TypeScript Integration

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

const { resource: kpiData } = useData<TeamKpiList>(httpClient, endpoints.teams.kpi(teamId), { shape: { fields: ['Kpi'] } })
```

## Usage in Portal

| Context                                                 | Source file                                                    |
| ------------------------------------------------------- | -------------------------------------------------------------- |
| Team dashboard KPI section (`/dashboard/team/{teamId}`) | `src/views/user/dashboards/team/components/TeamKpiSection.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}/metrics`    | Team performance metrics  |
| `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 |
