# Change a member's role; `owner` transfers ownership (owner only)

PATCH /api/agent/teams/{id}/members/{userId}. Required scopes: teams:write.

HTML: https://notify.belweave.ai/docs/api/patchTeamsIdMembersUserId

Required scopes: `teams:write`

```http
PATCH /api/agent/teams/{id}/members/{userId}
Authorization: Bearer ntf_your_token
```

## Operation schema

```json
{
  "summary": "Change a member's role; `owner` transfers ownership (owner only)",
  "operationId": "patchTeamsIdMembersUserId",
  "security": [
    {
      "bearer": [
        "teams:write"
      ]
    }
  ],
  "x-notify-scopes": [
    "teams:write"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "schema": {
        "type": "string"
      },
      "required": true
    },
    {
      "name": "userId",
      "in": "path",
      "schema": {
        "type": "string"
      },
      "required": true
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "role": {
              "type": "string",
              "enum": [
                "owner",
                "admin",
                "member"
              ]
            }
          },
          "required": [
            "role"
          ],
          "additionalProperties": false
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "member": {
                "$ref": "#/components/schemas/TeamMember"
              }
            },
            "required": [
              "member"
            ]
          }
        }
      }
    },
    "400": {
      "description": "Invalid request",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Missing, unknown, revoked, or expired token",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "The token lacks a required scope or the account lacks permission",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "404": {
      "description": "Not found for this account",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
```

Resolve schema references against [OpenAPI](https://notify.belweave.ai/openapi.json).
