# updateAccount

```graphql
mutation UpdateAccount($accountId: ID!, $input: UpdateAccountInput!) {
  updateAccount(accountId: $accountId, input: $input) {
    id
    slug
    name
    kind
    createdAt
    updatedAt
    membership {
      role
      capabilities
    }
  }
}
```

Change an account's name or slug. Requires account.settings.manage.

## Arguments

| Name         | Type                | Required | Description                                                                             |
| ------------ | ------------------- | -------- | --------------------------------------------------------------------------------------- |
| `accountId`  | ID!                 | Yes      |                                                                                         |
| `input`      | UpdateAccountInput! | Yes      |                                                                                         |
| `input.name` | String              |          | New account name. Omitted, the current name remains unchanged.                          |
| `input.slug` | String              |          | New account slug. Omitted, the current slug remains unchanged; a duplicate returns 409. |

## Variables

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

## Responses

| Status | Description                         |
| ------ | ----------------------------------- |
| 200    | The Account! in data.updateAccount. |

## 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 UpdateAccount($accountId: ID!, $input: UpdateAccountInput!) {\n  updateAccount(accountId: $accountId, input: $input) {\n    id\n    slug\n    name\n    kind\n    createdAt\n    updatedAt\n    membership {\n      role\n      capabilities\n    }\n  }\n}",
  "variables": {
    "accountId": "string",
    "input": {}
  }
}'
```

## Example response

```json
{
  "data": {
    "updateAccount": {
      "id": "string",
      "slug": "string",
      "name": "string",
      "kind": "string",
      "createdAt": "string",
      "updatedAt": "string",
      "membership": {
        "role": "string",
        "capabilities": [
          "string"
        ]
      }
    }
  }
}
```
