# createAccountApiKey

```graphql
mutation CreateAccountApiKey($input: CreateAccountApiKeyInput!) {
  createAccountApiKey(input: $input) {
    id
    accountId
    name
    key
    keyPrefix
    expiresAt
    createdAt
    scopes
    scope
  }
}
```

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

## Arguments

| Name              | Type                      | Required | Description |
| ----------------- | ------------------------- | -------- | ----------- |
| `input`           | CreateAccountApiKeyInput! | Yes      |             |
| `input.accountId` | ID!                       | Yes      |             |
| `input.name`      | String!                   | Yes      |             |
| `input.scopes`    | \[String!]                |          |             |
| `input.expiresAt` | String                    |          |             |

## Variables

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

## Responses

| Status | Description                                                  |
| ------ | ------------------------------------------------------------ |
| 200    | The CreateAccountApiKeyPayload! in data.createAccountApiKey. |

## 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 CreateAccountApiKey($input: CreateAccountApiKeyInput!) {\n  createAccountApiKey(input: $input) {\n    id\n    accountId\n    name\n    key\n    keyPrefix\n    expiresAt\n    createdAt\n    scopes\n    scope\n  }\n}",
  "variables": {
    "input": {
      "accountId": "string",
      "name": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "createAccountApiKey": {
      "id": "string",
      "accountId": "string",
      "name": "string",
      "key": "string",
      "keyPrefix": "string",
      "expiresAt": "string",
      "createdAt": "string",
      "scopes": [
        "string"
      ],
      "scope": "string"
    }
  }
}
```
