# ApiKeyProps

ApiKey Properties.

Extends: ApiKeyProps
Extends: ApiKeyOptions
Used as props by: ApiKey

- Source: [`aws-apigatewayv2/lib/websocket/api-key.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api-key.ts#L62)
- Type last changed: v2.212.0 · 20 Aug 2025

## Example

```ts
// Auto-generated name and value
const autoKey = new apigwv2.ApiKey(this, 'AutoKey');

// Explicit name and value
const explicitKey = new apigwv2.ApiKey(this, 'ExplicitKey', {
  apiKeyName: 'MyWebSocketApiKey',
  value: 'MyApiKeyThatIsAtLeast20Characters',
});
```

## Properties

- `apiKeyName`: string — A name for the API key.

  **Default:** automatically generated name

  If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the API key name.

- `customerId`: string = none — An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.

- `description`: string = none — A description of the purpose of the API key.

- `enabled`: boolean = true — Indicates whether the API key can be used by clients.

- `generateDistinctId`: boolean = false — Specifies whether the key identifier is distinct from the created API key value.

- `value`: string = none — The value of the API key.

  Must be at least 20 characters long.
