# deleteAccountMember

```graphql
mutation DeleteAccountMember($accountId: ID!, $userId: ID!) {
  deleteAccountMember(accountId: $accountId, userId: $userId) {
    ok
  }
}
```

Remove a member from the account, or leave it yourself; removing another member requires account.members.manage. Requires account.read; API keys also need delete scope.

## Arguments

| Name                                | Type    | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------------------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `accountId`                         | ID!     | Yes      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `userId`                            | ID!     | Yes      | Member to remove. Members may remove themselves. Removing another member requires account.members.manage. Removing another owner requires account ownership authority. The account must retain at least one owner. Removing an absent member returns 404. The member also loses access to every project in the account; with require\_project\_lead\_reassignment=true, removal is blocked with 409 while they lead active projects, which must be explicitly reassigned first. Omission preserves legacy automatic reassignment to an account owner. Projects and financial history are not touched. |
| `require_project_lead_reassignment` | Boolean |          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

## Variables

```json
{
  "accountId": "string",
  "userId": "string"
}
```

## Responses

| Status | Description                                      |
| ------ | ------------------------------------------------ |
| 200    | The DeletionResult! in data.deleteAccountMember. |

## 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 DeleteAccountMember($accountId: ID!, $userId: ID!) {\n  deleteAccountMember(accountId: $accountId, userId: $userId) {\n    ok\n  }\n}",
  "variables": {
    "accountId": "string",
    "userId": "string"
  }
}'
```

## Example response

```json
{
  "data": {
    "deleteAccountMember": {
      "ok": false
    }
  }
}
```
