Create a Webhook action

Create a Webhook action in the Admin Portal to forward matching events from an Events & Actions listener to your own HTTPS endpoint.

If you're migrating a webhook you previously configured on the Keysets page, see the legacy webhooks migration guide instead. It covers the payload differences and the exact steps to move it here.

Configure the action​

  1. In Events & Actions on the Admin Portal, click + Add Action.

  2. Click Webhook to select the action type.

  3. Enter the HTTPS URL of your endpoint under Configuration, for example https://your-domain.com/webhook/pubnub.

  4. If your endpoint requires authentication, add custom headers and select secret keys from your keyset.

  5. If you expect a high volume of events and want to send them together instead of one request per event, turn on Batching and set the item count and time bound. See Available actions for how the item count and time bound interact.

  6. If you want PubNub to retry failed deliveries automatically, turn on Webhook retry and set the retry count and interval.

  7. Pair the action with an event listener without leaving Actions. Click Add event listener and select an existing listener, or create one first.

  8. Click Save changes.

A Webhook delivery succeeds after a 2XX response, follows a 301 for up to three redirects, and retries other statuses according to the action's retry policy.

Events & Actions retries are available on paid tiers. The Free tier's single listener does not retry failed deliveries. See Available actions for the tier breakdown and the full retry mechanics.

Export Functions logs through a Webhook action

You can export logs from your Functions using a Webhook action configured the same way.

Confirm the webhook fires​

Publish a message, or trigger whichever event you configured, so it matches your listener's filter. For how publishing works, see Publishing messages with PubNub. Check that your endpoint receives a request. For the exact JSON your endpoint receives, see Payloads.

If your endpoint doesn't receive a request, confirm the action is paired with a listener whose filter matches the event you triggered. Also confirm your endpoint URL accepts HTTPS requests from PubNub.

Was this page useful?

Last updated on