> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update project member

> Changes a non-owner member's role to admin, editor or viewer; the owner changes only through updateProjectOwner.

`updateProjectMember(projectReference: ID!, userId: ID!, input: UpdateProjectMemberInput!): ProjectMember!`

Requires project.members.manage.

## Arguments

| Argument | Type | Required | Description |
| - | - | - | - |
| `projectReference` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | Yes | Project UUID, slug or domain. |
| `userId` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | Yes | User ID of an existing non-owner member. |
| `input` | [`UpdateProjectMemberInput!`](https://veryfront.com/docs/cloud/graphql/types/updateprojectmemberinput) | Yes | |

## Input fields

### input

[`UpdateProjectMemberInput`](https://veryfront.com/docs/cloud/graphql/types/updateprojectmemberinput)

| Field | Type | Required | Description |
| - | - | - | - |
| `role` | [`AssignableProjectRole!`](https://veryfront.com/docs/cloud/graphql/types/assignableprojectrole) | Yes | New role. Owner promotion and changing the current owner are rejected; use updateProjectOwner. |

## Response

Returns [`ProjectMember!`](https://veryfront.com/docs/cloud/graphql/types/projectmember). Open the type for its fields and nested types.

| Field | Type | Description |
| - | - | - |
| `userId` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | |
| `email` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `name` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | Display name; null when the member has none. |
| `avatarSrc` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | Avatar URL; null when the member has none. |
| `role` | [`ProjectRole!`](https://veryfront.com/docs/cloud/graphql/types/projectrole) | |
| `capabilities` | [`[String!]!`](https://veryfront.com/docs/cloud/graphql/types/string) | Project capabilities the role grants. |

Types marked with `!` cannot be null. Lists use `[Type]` notation. The [type index](https://veryfront.com/docs/cloud/graphql/schema.md) lists all published input and response types.

## Example

```graphql title="query.graphql" theme={null}
mutation UpdateProjectMember($projectReference: ID!, $userId: ID!, $input: UpdateProjectMemberInput!) {
  updateProjectMember(projectReference: $projectReference, userId: $userId, input: $input) {
    name
    avatarSrc
    capabilities
    email
    role
  }
}
```

```json title="variables.json" theme={null}
{
  "projectReference": "00000000-0000-4000-8000-000000000001",
  "userId": "00000000-0000-4000-8000-000000000001",
  "input": {
    "role": "admin"
  }
}
```

<details>
  <summary>Try this mutation</summary>

  Calls use `https://api.veryfront.com/graphql`. Replace sample values with resources you can access. See [Authentication](https://veryfront.com/docs/cloud/authentication.md) for credentials and permissions.

  Bearer token or API key

  Stored in this tab's session. Clear credential

  Mutation

  Variables (JSON)
</details>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.