# 在用户事件 webhook 中，能否辨别用户是如何登出的？

**URL:** https://meta.discourse.org/t/in-the-user-event-webhook-is-it-possible-to-discern-how-a-user-is-logged-out/117219
**Category:** Support
**Created:** [2019年五月8日 21:51 UTC](https://meta.discourse.org/t/in-the-user-event-webhook-is-it-possible-to-discern-how-a-user-is-logged-out/117219 "2019-05-08T21:51:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jezra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jezra/32/105986_2.png) [@jezra](https://meta.discourse.org/u/jezra)
#### Post date: [2019年五月8日 21:51 UTC](https://meta.discourse.org/t/in-the-user-event-webhook-is-it-possible-to-discern-how-a-user-is-logged-out/117219/1 "2019-05-08T21:51:07Z")

</div>

When a user logs out of my Discourse instance, the user\_event webhook is triggered. Similarly, when a user is logged out by an API call to Discourse, the user\_event webhook is also triggered.

I am curious if it is possible, at the webkhook payload URL, to determine if the user logout was initiated by the user or by the API.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2019年五月9日 01:33 UTC](https://meta.discourse.org/t/in-the-user-event-webhook-is-it-possible-to-discern-how-a-user-is-logged-out/117219/2 "2019-05-09T01:33:41Z")

</div>

If you made the API call to log them out then you can also call the web hook when you do that.

---

<div class="post-metadata">

### Author: ![jezra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jezra/32/105986_2.png) [@jezra](https://meta.discourse.org/u/jezra)
#### Post date: [2019年五月9日 02:05 UTC](https://meta.discourse.org/t/in-the-user-event-webhook-is-it-possible-to-discern-how-a-user-is-logged-out/117219/3 "2019-05-09T02:05:26Z")

</div>

The webhook is already being called. The problem I’m having is the inability to determine on the server hosting the webhook payload URL, if the incoming request was generated by an API logout or the user choosing to logout.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2022年九月7日 07:12 UTC](https://meta.discourse.org/t/in-the-user-event-webhook-is-it-possible-to-discern-how-a-user-is-logged-out/117219/4 "2022-09-07T07:12:23Z")

</div>


