# updateAccountApiKey

```graphql
mutation UpdateAccountApiKey($input: UpdateAccountApiKeyInput!) {
  updateAccountApiKey(input: $input) {
    apiKey {
      id
      accountId
      name
      keyPrefix
      lastUsedAt
      expiresAt
      createdAt
      updatedAt
      status
      revokedAt
      scopes
      scope
    }
  }
}
```

Update account API key as a signed-in account administrator. Requires account.settings.manage.

## Arguments

| Name              | Type                      | Required | Description |
| ----------------- | ------------------------- | -------- | ----------- |
| `input`           | UpdateAccountApiKeyInput! | Yes      |             |
| `input.accountId` | ID!                       | Yes      |             |
| `input.id`        | ID!                       | Yes      |             |
| `input.name`      | String                    |          |             |
| `input.expiresAt` | String                    |          |             |

## Variables

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

## Responses

| Status | Description                                                  |
| ------ | ------------------------------------------------------------ |
| 200    | The UpdateAccountApiKeyPayload! in data.updateAccountApiKey. |

## 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 UpdateAccountApiKey($input: UpdateAccountApiKeyInput!) {\n  updateAccountApiKey(input: $input) {\n    apiKey {\n      id\n      accountId\n      name\n      keyPrefix\n      lastUsedAt\n      expiresAt\n      createdAt\n      updatedAt\n      status\n      revokedAt\n      scopes\n      scope\n    }\n  }\n}",
  "variables": {
    "input": {
      "accountId": "string",
      "id": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateAccountApiKey": {
      "apiKey": {
        "id": "string",
        "accountId": "string",
        "name": "string",
        "keyPrefix": "string",
        "lastUsedAt": "string",
        "expiresAt": "string",
        "createdAt": "string",
        "updatedAt": "string",
        "status": "string",
        "revokedAt": "string",
        "scopes": [
          "string"
        ],
        "scope": "string"
      }
    }
  }
}
```
