curl -X POST https://{region}.api.konghq.com/v1/event-gateways/{eventGatewayId}/static-keys \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "my-key",
"value": "'$MY_KEY'"
}
'
Make sure to replace the following placeholders with your own values:
-
region: Geographic region where your Kong Konnect is hosted and operates.
-
KONNECT_TOKEN: Your Personal Access Token (PAT) associated with your Konnect account.
-
virtualClusterId: The id of the Virtual Cluster.
-
eventGatewayId: The id of the Event Gateway.
-
eventGatewayListenerId: The id of the Event Gateway Listener.
See the Konnect Event Gateway API reference to learn about region-specific URLs and personal access tokens.
The following creates a new static key called my-key.
Add this snippet to an event_gateways resource in your declarative configuration file, and then manage it with kongctl:
event_gateways:
- ref: eventGatewayName
name: eventGatewayName
static_keys:
- ref: my-key
name: my-key
value: "$MY_KEY"
Make sure to replace the following placeholders with your own values:
-
eventGatewayName: The name of your Event Gateway.