# updateAccountMember

```graphql
mutation UpdateAccountMember($input: AccountMemberUpdateInput!) {
  updateAccountMember(input: $input) {
    membershipId
    userId
    email
    name
    avatarSrc
    role
    invitedByUserId
    createdAt
    updatedAt
  }
}
```

Change an account member's role. Requires account.members.manage.

## Arguments

| Name              | Type                      | Required | Description                                                                                                                                                                            |
| ----------------- | ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input`           | AccountMemberUpdateInput! | Yes      |                                                                                                                                                                                        |
| `input.accountId` | ID!                       | Yes      |                                                                                                                                                                                        |
| `input.userId`    | ID!                       | Yes      |                                                                                                                                                                                        |
| `input.role`      | String!                   | Yes      | Member role. Promoting to or demoting from owner requires account ownership authority. The account must retain at least one owner. Setting the current role succeeds without a change. |

## Variables

```json
{
  "input": {
    "accountId": "string",
    "userId": "string",
    "role": "owner"
  }
}
```

## Responses

| Status | Description                                     |
| ------ | ----------------------------------------------- |
| 200    | The AccountMember! in data.updateAccountMember. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation UpdateAccountMember($input: AccountMemberUpdateInput!) {\n  updateAccountMember(input: $input) {\n    membershipId\n    userId\n    email\n    name\n    avatarSrc\n    role\n    invitedByUserId\n    createdAt\n    updatedAt\n  }\n}",
  "variables": {
    "input": {
      "accountId": "string",
      "userId": "string",
      "role": "owner"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateAccountMember": {
      "membershipId": "string",
      "userId": "string",
      "email": "user@example.com",
      "name": "string",
      "avatarSrc": "string",
      "role": "string",
      "invitedByUserId": "string",
      "createdAt": "string",
      "updatedAt": "string"
    }
  }
}
```
