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

# List Team Profiles

> Returns team profile summaries including member lists, permissions, and recent bookings for the booking flow.

# List Team Profiles

Returns an array of team profile summaries for teams the authenticated customer belongs to. Each entry includes the team's details, permission flags (can add/remove/cancel members), all team members with their contracts, and recent bookings. Primarily used in the booking flow to populate the "book for team" selector.

<Note>
  This endpoint uses a view-style URL (`/en/team/profiles`) rather than the `/api/public/` convention. It returns server-rendered JSON and is called
  with the `bookForTeam=true` query parameter in the booking context.
</Note>

## Authentication

Requires a valid customer bearer token.

## Query Parameters

<ParamField query="bookForTeam" type="boolean">
  When `true`, scopes the response to teams the customer can book on behalf of. Added conditionally in the booking flow.
</ParamField>

<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

Returns an array of `TeamProfile` objects (not wrapped in a list envelope).

### TeamProfile Fields

<ResponseField name="[].CanAddNewMembers" type="boolean">
  Whether the authenticated customer can add new members to this team.
</ResponseField>

<ResponseField name="[].CanRemoveMembers" type="boolean">
  Whether the authenticated customer can remove members from this team.
</ResponseField>

<ResponseField name="[].CanCancelMembers" type="boolean">
  Whether the authenticated customer can cancel member contracts in this team.
</ResponseField>

<ResponseField name="[].Team" type="Team">
  Full team object with the same fields as the response from [`GET /api/public/teams/{teamId}/profile`](/api/endpoints/teams/team-details).
</ResponseField>

<ResponseField name="[].RecentBookings" type="any">
  Recent bookings made by team members.
</ResponseField>

<ResponseField name="[].AllTeamMembers" type="AllTeamMember[]">
  Extended member objects that include contract information alongside standard `Customer` fields.
</ResponseField>

<ResponseField name="[].AllTeamMembers[].Contracts" type="CoworkerContract[]">
  Active contracts for this member, including plan name, start date, next invoice date, price, and cancellation details.
</ResponseField>

## Examples

### Fetch team profiles for booking

```http theme={null}
GET /en/team/profiles?bookForTeam=true
Authorization: Bearer {token}
```

```json theme={null}
[
  {
    "CanAddNewMembers": true,
    "CanRemoveMembers": true,
    "CanCancelMembers": false,
    "Team": {
      "Id": 55,
      "Name": "Tech Innovators",
      "BusinessName": "Downtown Coworking Hub",
      "TeamMembersCount": 12,
      "ProfileSummary": "Building the future",
      "MaxTeamMemberCount": 20
    },
    "RecentBookings": null,
    "AllTeamMembers": [
      {
        "Id": 101,
        "FullName": "Jane Smith",
        "Email": "jane@techinnovators.com",
        "Contracts": [
          {
            "Id": 5001,
            "StartDate": "2024-01-15T00:00:00",
            "NextInvoice": "2025-02-01T00:00:00",
            "Price": 250.0,
            "CurrencyCode": "GBP"
          }
        ]
      }
    ]
  }
]
```

## TypeScript Integration

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

const { resource: teamProfiles } = useData<TeamProfiles>(httpClient, endpoints.teams.profiles)
```

## Usage in Portal

| Context                                      | Source file                                            |
| -------------------------------------------- | ------------------------------------------------------ |
| Booking flow team selector (`/checkout/...`) | `src/views/public/checkout/booking/useBookingData.tsx` |

## Error Responses

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

## Related Endpoints

| Method | Endpoint                             | Description               |
| ------ | ------------------------------------ | ------------------------- |
| `GET`  | `/api/public/teams/my`               | List the customer's teams |
| `GET`  | `/api/public/teams/{teamId}/profile` | Full team profile         |
| `POST` | `/api/public/teams/{teamId}/members` | Add members to a team     |
