---
title: "PATCH /teams/{team_id}/members/{user_id}"
method: PATCH
path: "/teams/{team_id}/members/{user_id}"
tags: ["Teams"]
---

# PATCH /teams/{team_id}/members/{user_id}

`PATCH /teams/{team_id}/members/{user_id}`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/teams/{team_id}/members/{user_id}`
- Auth: HTTP bearer

## Path parameters

- `team_id` integer, required
- `user_id` integer, required

## Request body

- UpdateMemberRoleRequest: The new fixed role for an existing membership.
  - `role` 'owner' | 'admin' | 'deployer' | 'viewer', required: Role a user holds within a team, or that a team holds on a project. Named `TeamRole` rather than `Role` to keep it distinct from `temps_auth::permissions::Role`, which is the instance-wide role (Admin/User/…) attached to a session. The two are orthogonal: the instance-wide role decides whether you may touch a resource *kind* at all, `TeamRole` decides what you may do *within a project* you have team access to. See `temps_teams::fixed_role_permissions` for the project-scoped permission set each variant maps to. Stored as a `varchar(32)` rather than a Postgres enum so the role set can evolve in pure migration code without a schema-level enum alteration blocking a downgrade.

## Response `200`

Updated membership

- TeamMemberResponse
  - `added_by` integer, required
  - `created_at` string, date-time, required
  - `id` integer, required
  - `role` 'owner' | 'admin' | 'deployer' | 'viewer', required: The source of this member's project-scoped permissions, intersected with `project_team_access.role`.
  - `team_id` integer, required
  - `updated_at` string, date-time, required
  - `user_email` string, nullable: The member's email, joined from `users`.
  - `user_id` integer, required
  - `user_name` string, nullable: The member's display name, joined from `users`. `None` if the referenced user no longer exists.

## Other responses

- `403`: Insufficient permissions
- `404`: Member not found

## Changes

- **2026-08-06** `fe64cc48eb6f`: 1 info
  - endpoint added
- **2026-08-06** `949964f26dd7`: 1 breaking
  - api path removed without deprecation
- **2026-08-04** `f5b05de1dacb`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/teams/:team_id/members/:user_id/patch.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
