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

# Get Team Members

> Retrieve all members of a specific team

# Get Team Members

Retrieve a list of all members in a specific team with their roles and details.

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET 'https://api.weir.ai/org/team/members/team_123456789' \
    -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
    -H 'x-source: console'
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "data": {
      "members": [
        {
          "userId": "user_123456789",
          "fullname": "John Doe",
          "email": "john.doe@example.com",
          "role": "Team_Lead",
          "joinedAt": "2024-01-15T10:30:00Z",
          "status": "active"
        },
        {
          "userId": "user_987654321",
          "fullname": "Jane Smith",
          "email": "jane.smith@example.com",
          "role": "Team_Member",
          "joinedAt": "2024-01-20T14:15:00Z",
          "status": "active"
        }
      ],
      "teamId": "team_123456789",
      "teamName": "Development Team",
      "memberCount": 2
    },
    "message": "Team members retrieved successfully",
    "status": "success"
  }
  ```
</ResponseExample>

## Authentication

Requires Console API authentication with bearer token and `x-source: console` header.

## Path Parameters

<ParamField path="teamId" type="string" required>
  Unique identifier of the team to retrieve members from.
</ParamField>

## Response Fields

<ResponseField name="data" type="object" required>
  Team members data object.

  <Expandable title="Team Members Data Properties">
    <ResponseField name="data.members" type="array" required>
      Array of team member objects.

      <Expandable title="Member Object Properties">
        <ResponseField name="data.members[].userId" type="string" required>
          Unique identifier for the user.
        </ResponseField>

        <ResponseField name="data.members[].fullname" type="string" required>
          Full name of the team member.
        </ResponseField>

        <ResponseField name="data.members[].email" type="string" required>
          Email address of the team member.
        </ResponseField>

        <ResponseField name="data.members[].role" type="string" required>
          Role of the member in the team.
        </ResponseField>

        <ResponseField name="data.members[].joinedAt" type="timestamp" required>
          ISO 8601 formatted timestamp when the member joined the team.
        </ResponseField>

        <ResponseField name="data.members[].status" type="string" required>
          Member status (e.g., "active", "inactive", "pending").
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="data.teamId" type="string" required>
      Team identifier.
    </ResponseField>

    <ResponseField name="data.teamName" type="string" required>
      Name of the team.
    </ResponseField>

    <ResponseField name="data.memberCount" type="integer" required>
      Total number of members in the team.
    </ResponseField>
  </Expandable>
</ResponseField>

## Usage Examples

<CodeGroup>
  ```javascript JavaScript theme={null}
  const getTeamMembers = async (teamId, accessToken) => {
    try {
      const response = await fetch(`https://api.weir.ai/org/team/members/${teamId}`, {
        method: 'GET',
        headers: {
          'Authorization': `Bearer ${accessToken}`,
          'x-source': 'console'
        }
      });
      
      if (!response.ok) {
        throw new Error(`HTTP error! status: ${response.status}`);
      }
      
      const data = await response.json();
      return data.data;
    } catch (error) {
      console.error('Get team members error:', error);
      throw error;
    }
  };

  // Usage
  const teamData = await getTeamMembers('team_123456789', 'your_access_token');
  console.log(`Team: ${teamData.teamName}`);
  console.log(`Members: ${teamData.memberCount}`);
  teamData.members.forEach(member => {
    console.log(`- ${member.fullname} (${member.role})`);
  });
  ```

  ```python Python theme={null}
  import requests

  def get_team_members(team_id, access_token):
      try:
          response = requests.get(
              f'https://api.weir.ai/org/team/members/{team_id}',
              headers={
                  'Authorization': f'Bearer {access_token}',
                  'x-source': 'console'
              }
          )
          response.raise_for_status()
          return response.json()['data']
      except requests.exceptions.RequestException as e:
          print(f'Get team members error: {e}')
          raise

  # Usage
  team_data = get_team_members('team_123456789', 'your_access_token')
  print(f'Team: {team_data["teamName"]}')
  print(f'Members: {team_data["memberCount"]}')
  for member in team_data['members']:
      print(f'- {member["fullname"]} ({member["role"]})')
  ```

  ```php PHP theme={null}
  function getTeamMembers($teamId, $accessToken) {
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, "https://api.weir.ai/org/team/members/$teamId");
      curl_setopt($ch, CURLOPT_HTTPHEADER, [
          'Authorization: Bearer ' . $accessToken,
          'x-source: console'
      ]);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      
      $response = curl_exec($ch);
      $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
      curl_close($ch);
      
      if ($httpCode !== 200) {
          throw new Exception("HTTP error: $httpCode");
      }
      
      return json_decode($response, true)['data'];
  }
  ```
</CodeGroup>

<Tip>
  **Pro Tip**: Use this endpoint to display team member lists in your UI and enable team management features like role updates and member removal.
</Tip>
