# Update team member

This endpoint requires a [global API token](https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-a-global-api-token), because a member's phone numbers apply to every team in your organization.

[info]
#### Member in more than one organization or managed through SCIM?
A member who is in more than one organization can only change their phone numbers themselves, in their [account settings](https://betterstack.com/docs/uptime/phone-number/). A phone number that your identity provider manages through SCIM can't be removed with this endpoint.
[/info]

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

[[path_param]]
name = "id"
description = "The ID of the team member, as returned by the [List](https://betterstack.com/docs/uptime/api/team-members/list/) or [Get](https://betterstack.com/docs/uptime/api/team-members/get/) team members API."
required = true
type = "string"

[[query_param]]
name = "team_name"
description = "The team to return the member's role for."
required = false
type = "string"

[[body_param]]
name = "phone_numbers"
description = "The phone numbers of the team member in international format, like `+14155550123`. The list replaces every current phone number, so send `[]` to remove them all."
required = false
type = "array of strings"

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

[[header]]
name = "Content-Type"
description = "application/json"
required = true
type = "string"
[/endpoint]

[responses]
[[response]]
status = 200
description = '''Returns the updated team member.'''
body = '''{
  "data": {
    "id": "101",
    "type": "team_member",
    "attributes": {
      "email": "alice@example.com",
      "first_name": "Alice",
      "last_name": "Smith",
      "created_at": "2023-10-26T10:00:00.000Z",
      "role": "admin",
      "role_id": 101,
      "mobile_app_platforms": ["ios", "android"],
      "phone_numbers": ["+14155550123", "+14155550199"]
    }
  }
}'''

[[response]]
status = 403
description = '''The request used a team-scoped Incidents API token.'''
body = '''{
  "errors": "Changing phone numbers requires a global API token."
}'''

[[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 = 422
description = '''A phone number is not valid.'''
body = '''{
  "errors": "\"12345\" isn't a valid phone number. Use the international format, such as +1 628 900 3830."
}'''
[/responses]

#### Example cURL

```shell
[label Replace phone numbers]
curl --request PATCH \
  --url "https://betterstack.com/api/v2/team-members/101" \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "phone_numbers": ["+14155550123", "+14155550199"]
  }'
```
