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

# Remove Team Member

> Removes a member from a team by their customer ID.

# Remove Team Member

Removes a single member from a team. The customer cannot remove themselves — attempting to do so returns a `CANNOT_REMOVE_ITSELF` error. Members with active contracts should have their contracts cancelled before removal.

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

<ParamField path="coworkerId" type="number" required>
  Numeric identifier of the customer to remove. Returned as `Id` in the `AllTeamMembers` array from [`GET /api/public/teams/{teamId}
      /profile`](/api/endpoints/teams/team-details).
</ParamField>

## Response

Returns HTTP `200 OK` with an empty body on success.

## Examples

### Remove a member

```http theme={null}
DELETE /api/public/teams/55/members/102
Authorization: Bearer {token}
```

```
Status: 200 OK
Body: (empty)
```

## TypeScript Integration

```typescript theme={null}
import { endpoints } from '@/api/endpoints'

await httpClient.delete(endpoints.teams.removeMember(teamId, coworkerId))
```

## Usage in Portal

| Context                                       | Source file                                                          |
| --------------------------------------------- | -------------------------------------------------------------------- |
| Team members table (`/team/members/{teamId}`) | `src/views/user/team/members/components/TeamMembersTableSection.tsx` |

## Error Responses

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

<ResponseField name="403 Forbidden" type="error">
  The customer is not an administrator of the specified team.
</ResponseField>

<ResponseField name="400 Bad Request" type="error">
  The request is invalid — for example, the member has active contracts, or the response message is `CANNOT_REMOVE_ITSELF` when attempting
  self-removal.
</ResponseField>

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

## Related Endpoints

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