An API key lets your own code prove who it is when it sends events to a webhook. In this guide you create a key that can only do one thing: post events to your webhooks. That's the ingress:write permission the webhook's Require API Key protection checks for.
Open Settings → API Keys
In the left sidebar, click Settings, then the API Keys card under Security.
- Marker 1: Open Settings.
- Marker 2: Click API Keys.
Start a new key
- Marker 1: Click + New API Key.
Name it and choose Ingress → Write
Give the key a name that says who will use it, then set its permissions. A new key starts with Events & Deliveries → Read selected, so clear that first.
- Marker 1: Name: here Store orders sender, the app that will post orders.
- Marker 2: Click Clear to unselect every permission.
- Marker 3: Under Ingress, click Write. It's the only permission this key needs.
- Marker 4: Don't click Create Key yet. Check the expiry first (step 04).
Give each key only what it needs. A key with just Ingress → Write can send events but can't read your data or change your webhooks, so a leaked key does far less damage.
Set when it expires
Scroll to the bottom of the form.
- Marker 1: Expires in (days): from 1 to 365. Leave it empty for the default of 90 days.
- Marker 2: Click Create Key.
Copy the key
The key is shown once, right after you create it.
- Marker 1: Store this key securely: it won't be shown again.
- Marker 2: Your new key, starting with
hwk_. It's blurred in this picture. - Marker 3: Copy Key copies it.
- Marker 4: Done closes the dialog. Copy the key before you click it.
Keep the key secret.
Paste it straight into the place your code reads secrets from, such as an environment variable or your hosting provider's secret settings. Never put it in a web page, a browser script or a public repository. If you lose it, create a new key; there's no way to see this one again.
Check the key in the list
- Marker 1: The key's name, and the first characters of the key so you can tell keys apart.
- Marker 2: ingress:write: the permission from step 03.
- Marker 3: When it expires. Last used changes once your code starts sending.
- Marker 4: Edit changes the name or permissions. Revoke turns the key off for good.
Allow it on your webhook
Open the webhook that should accept this key, click Edit on Configuration, turn on Require API Key and pick the key under Allowed API Keys. Set up a Webhook node, step 05, shows each screen.
- Marker 1: The key you just created, allowed on this webhook.
- Marker 2: Allow another API key… adds more senders.
- Marker 3: Only the keys in this list can post here.
Then send the key in the Authorization header of every request:
curl -X POST "https://api.hostwebhook.com/api/in/YOUR_WEBHOOK_ID" \
-H "Authorization: Bearer $HOSTWEBHOOK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":"ord_1042","total":59.90}'Older keys with events:write
Keys made before the ingress:write scope existed carry events:write. They still open a webhook that requires an API key, but events:write can also replay and cancel events, retry deliveries and purge the dead-letter queue. For a key you hand to a sender, Ingress → Write is the right choice.