# accountApiKeys

```graphql
query AccountApiKeys($input: AccountApiKeysInput!) {
  accountApiKeys(input: $input) {
    data {
      id
      accountId
      name
      keyPrefix
      lastUsedAt
      expiresAt
      createdAt
      updatedAt
      status
      revokedAt
      scopes
      scope
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    totalCount
  }
}
```

List account API keys as a signed-in account administrator. Requires account.settings.manage.

## Arguments

| Name              | Type                 | Required | Description                                                        |
| ----------------- | -------------------- | -------- | ------------------------------------------------------------------ |
| `input`           | AccountApiKeysInput! | Yes      |                                                                    |
| `input.accountId` | ID!                  | Yes      |                                                                    |
| `input.limit`     | Int                  |          |                                                                    |
| `input.cursor`    | String               |          |                                                                    |
| `input.status`    | String               |          |                                                                    |
| `input.sortBy`    | ApiKeySortBy         |          | Default `created_at`. One of `created_at`, `name`, `last_used_at`. |
| `input.sortOrder` | ApiKeySortOrder      |          | Default `desc`. One of `asc`, `desc`.                              |

## Variables

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

## Responses

| Status | Description                                        |
| ------ | -------------------------------------------------- |
| 200    | The AccountApiKeysPayload! in data.accountApiKeys. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query AccountApiKeys($input: AccountApiKeysInput!) {\n  accountApiKeys(input: $input) {\n    data {\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    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n    }\n    totalCount\n  }\n}",
  "variables": {
    "input": {
      "accountId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "accountApiKeys": {
      "data": [
        {
          "id": "string",
          "accountId": "string",
          "name": "string",
          "keyPrefix": "string",
          "lastUsedAt": "string",
          "expiresAt": "string",
          "createdAt": "string",
          "updatedAt": "string",
          "status": "string",
          "revokedAt": "string",
          "scopes": [
            "string"
          ],
          "scope": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "string",
        "endCursor": "string"
      },
      "totalCount": 0
    }
  }
}
```
