---
raw: true
search:
  tags:
    - Teams
    - PATCH
seo:
  description: >-
    Changes a member's role by member id or user email. Only an… Reference for
    the PATCH /v1/teams/{teamId}/members/{memberId} endpoint in the Spacefast
    API.
sidebar:
  label: Change a team member's role
  badge: PATCH
title: Change a team member's role
type: openapi-operation
---
Changes a member's role by member id or user email. Only an owner can grant the owner role, and the last owner's role cannot be changed until another owner exists.

`PATCH /v1/teams/{teamId}/members/{memberId}`

**Request body** (`application/json`, required)

- `role` (string, required) — The role to grant this member.

Request body example:

```json
{
  "role": "owner"
}
```

**Responses**

- `200` — Response for status 200
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 200:

```json
{
  "$schema": "http://example.com",
  "data": {
    "id": "string",
    "teamId": "string",
    "userId": "string",
    "role": "owner",
    "via": "direct",
    "createdAt": "2019-08-24T14:15:22Z",
    "user": {
      "id": "string",
      "name": "string",
      "email": "user@example.com",
      "image": "string"
    }
  }
}
```
