# social.coves.aggregator.getApiKey

> Published by [coves.social](https://lexicon.garden/identity/did:web:coves.social)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:web:coves.social/social.coves.aggregator.getApiKey)
- [Documentation](https://lexicon.garden/lexicon/did:web:coves.social/social.coves.aggregator.getApiKey/docs)
- [Examples](https://lexicon.garden/lexicon/did:web:coves.social/social.coves.aggregator.getApiKey/examples)

## Definitions

### `social.coves.aggregator.getApiKey`

**Type**: `query`

Get information about the authenticated aggregator's API key. Note: The actual key value is NEVER returned - only metadata about the key.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `hasKey` | `boolean` | Yes | Whether the aggregator has an API key (active or revoked) |
| `keyInfo` | `ref` → `social.coves.aggregator.defs#apiKeyView` | No | API key metadata. Only present if hasKey is true. |

#### Errors

- **AuthenticationRequired**: Authentication is required to get API key info
- **AggregatorRequired**: Only registered aggregators can get API key info
- **AggregatorNotFound**: Aggregator not found

## Raw Schema

```json
{
  "id": "social.coves.aggregator.getApiKey",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "AuthenticationRequired",
          "description": "Authentication is required to get API key info"
        },
        {
          "name": "AggregatorRequired",
          "description": "Only registered aggregators can get API key info"
        },
        {
          "name": "AggregatorNotFound",
          "description": "Aggregator not found"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "hasKey"
          ],
          "properties": {
            "hasKey": {
              "type": "boolean",
              "description": "Whether the aggregator has an API key (active or revoked)"
            },
            "keyInfo": {
              "ref": "social.coves.aggregator.defs#apiKeyView",
              "type": "ref",
              "description": "API key metadata. Only present if hasKey is true."
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {},
        "description": "No parameters required. Returns key info for the authenticated aggregator."
      },
      "description": "Get information about the authenticated aggregator's API key. Note: The actual key value is NEVER returned - only metadata about the key."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
