---
title: "Update team membership for a user"
method: PUT
path: "/api/v3/teams/{team_id}/memberships/{user_id}"
tags: ["Team Members"]
---

# Update team membership for a user

`PUT /api/v3/teams/{team_id}/memberships/{user_id}`

## Request

- Base URL: `https://codemagic.io`
- URL: `https://codemagic.io/api/v3/teams/{team_id}/memberships/{user_id}`
- Auth: API key in header `x-auth-token`
- TypeScript: <https://skmtc.dev/codemagic/apis/codemagic-api/docs/api/v3/teams/:team_id/memberships/:user_id/put.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `user_id` string, required
- `team_id` string, required

## Request body

- UpdateMembershipSchema
  - `role` 'admin' | 'member': A team role that can be granted to a member or an invitee. Ownership can't be granted.
  - `roles` union[]
    - union
      - TeamRoleGrant
        - `role` 'admin' | 'member', required: A team role that can be granted to a member or an invitee. Ownership can't be granted.
        - `scope` 'team', required
      - AppRoleGrant
        - `app_id` string, required
        - `role` 'app_developer' | 'app_viewer', required: An app role a member or an invitee can hold.
        - `scope` 'app', required

## Response `200`

Request fulfilled, document follows

## Other responses

- `400`: The request could not be validated
- `401`: Authentication is missing or invalid
- `403`: The caller lacks the required permission
- `404`: The requested resource does not exist
- `429`: The rate limit has been exceeded

---

[API](https://skmtc.dev/codemagic/apis/codemagic-api.md) - [All operations](https://skmtc.dev/codemagic/apis/codemagic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/codemagic/apis/codemagic-api/revisions/be09630f65e2?raw)
