Webhook Payload

We’re looking to potentially use webhooks to send data on certain types of events for metrics purposes. Are the payloads for these events listed anywhere, or are the webhook payloads identical to the ones in the Discourse API?

For example, we may set up one for user events, and in that case would the payload contain all the standard user JSON returned in the /admin/users/list/{flag}.json endpoint, or would it be different? Same question for post events with the /posts.json endpoint, and topics with /latest.json.

Along those lines, I know with the aforementioned user endpoint you can specify show_emails=true when using the API, so I was wondering - does the payload from the webhook include emails?

1 Like

I do not know of a list of the webhook payloads. The payloads are similar to what you see in the Discourse API documentation, but some fields are not included in the payload and in a few cases extra fields are added.

The easiest way I know of to see what gets sent in the payload is to configure a webhook on Discourse to point to http://example.com and then perform an action on the site to trigger the webhook. You can then see the payload by clicking the “Request” button from the webhook’s events list:

That screenshot is for a User Event webhook. You’ll see that the user’s email address is included in the payload.

3 Likes

Thanks, I setup a test webhook and I’ve got my payloads now.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.