# Remove a team member from team by ID

Removes a member from the team by their ID. This action cannot be undone.

[info]
Removing a user with the `admin` role is not permitted via the API.
[/info]

[endpoint]
base_url = "https://betterstack.com"
path = "/api/v2/team-members/{id}"
method = "DELETE"

[[path_param]]
name = "id"
description = "The ID of the team member to remove."
required = true
type = "string"

[[query_param]]
name = "team_name"
description = "Required if using a [global API token](https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-a-global-api-token) to specify the team."
required = false
type = "string"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"
[/endpoint]

[responses]
[[response]]
status = 204
description = '''The team member was successfully removed.'''

[[response]]
status = 404
description = '''The team member with the specified ID was not found.'''
body = '''{
  "errors": "Resource type user with id = 999 was not found"
}'''

[[response]]
status = 403
description = '''Removing an admin is forbidden.'''
body = '''{
  "errors": "Removing admins is not allowed via API"
}'''
[/responses]

#### Example cURL

```shell
[label Example]
curl --request DELETE \
  --url "https://betterstack.com/api/v2/team-members/102" \
  --header "Authorization: Bearer $TOKEN"
```
