# Is there any endpoint that would provide a user's external account IDs from their Discourse ID?

**URL:** https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911
**Category:** Support
**Created:** [February 20, 2022, 11:48pm UTC](https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911 "2022-02-20T23:48:38Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![cookieman768](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cookieman768/32/118511_2.png) [@cookieman768](https://meta.discourse.org/u/cookieman768)
#### Post date: [February 20, 2022, 11:48pm UTC](https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911/1 "2022-02-20T23:48:38Z")

</div>

Continuing the discussion from [Get external\_id by user for associated accounts?](https://meta.discourse.org/t/get-external-id-by-user-for-associated-accounts/213557):

I saw that this question was asked here, but I don’t think that it got traction since it was only in the dev category. I’m wondering if anything like this exists or is possible, even if it isn’t documented. I really need a way of getting all of their associated accounts, and ideally I wouldn’t want to have to store it in a separate database and have to keep it in sync (e.g. a user removes their social account.)

---

<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: [February 20, 2022, 11:57pm UTC](https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911/2 "2022-02-20T23:57:12Z")

</div>

You can see the info in the admin panel, I think so you can [How to reverse engineer the Discourse API](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576).

---

<div class="post-metadata">

### Author: ![cookieman768](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cookieman768/32/118511_2.png) [@cookieman768](https://meta.discourse.org/u/cookieman768)
#### Post date: [February 21, 2022, 12:03am UTC](https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911/3 "2022-02-21T00:03:12Z")

</div>

Yeah, so there is an `associated_accounts` section, but the thing is it doesn’t show the external ID such as what you would need to use with [Discourse API Docs](https://docs.discourse.org/#operation/getUserIdentiyProviderExternalId) which is my problem.

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/f/bff494659fedd756fbb5be12d77217b1f623f40f.png)

For example, I would need to get the Discord user ID or the Steam ID 64 which isn’t accessible from the endpoint.

---

<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: [February 21, 2022, 12:25am UTC](https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911/4 "2022-02-21T00:25:39Z")

</div>

What is the problem that you’re trying to solve? What are you going to do with the external account info?

I don’t know if there is an API that exposes those. I would have to look at the source. Perhaps someone else does.

You might need a plugin that solves your problem. Maybe just add the info to the user serializer for admins.

---

<div class="post-metadata">

### Author: ![cookieman768](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cookieman768/32/118511_2.png) [@cookieman768](https://meta.discourse.org/u/cookieman768)
#### Post date: [February 21, 2022, 12:29am UTC](https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911/5 "2022-02-21T00:29:16Z")

</div>

Yeah, so basically I was using [Discourse SSO](https://meta.discourse.org/t/13045?silent=true) on an external site and was needing to see if a user has associated their accounts. If they have then I needed their IDs in order to execute certain actions. I just really wanted to avoid having them sign in on that external site with Discord OAuth or Steam OpenID because it seemed redundant and would mean certain things might not be in sync with Discourse.

---

<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: [February 21, 2022, 12:38am UTC](https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911/6 "2022-02-21T00:38:06Z")

</div>

Well, I still don’t quite understand, but I think you’ll need a plugin.

---

<div class="post-metadata">

### Author: ![cookieman768](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cookieman768/32/118511_2.png) [@cookieman768](https://meta.discourse.org/u/cookieman768)
#### Post date: [February 21, 2022, 6:00pm UTC](https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911/7 "2022-02-21T18:00:44Z")

</div>

Oh, it’s possible to create a custom api endpoint with a plugin? I’m going to have to look into that. Thank you!

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [February 21, 2022, 6:13pm UTC](https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911/8 "2022-02-21T18:13:11Z")

</div>

> [@cookieman768](#):
>
> I would need to get the Discord user ID or the Steam ID 64 which isn’t accessible from the endpoint.

You can create a custom endpoint with that information using [How to run Data Explorer queries with the Discourse API](https://meta.discourse.org/t/how-to-run-data-explorer-queries-with-the-discourse-api/120063)

---

<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: [February 21, 2022, 6:15pm UTC](https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911/9 "2022-02-21T18:15:07Z")

</div>

Oh! Wow. Very cool. I knew you could create custom queries and call the from the API, but it hadn’t occured to me that it was an `endpoint`. Awesome.

---

<div class="post-metadata">

### Author: ![cookieman768](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cookieman768/32/118511_2.png) [@cookieman768](https://meta.discourse.org/u/cookieman768)
#### Post date: [February 22, 2022, 2:12am UTC](https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911/10 "2022-02-22T02:12:49Z")

</div>

Thank you for all the help both of you! It looks like the [data explorer](https://meta.discourse.org/t/32566?silent=true) might be what I need. I’m going to give that a try right now.

Edit: Yeah, wow - that’s such a powerful plugin. Thank you!

---

<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: [March 24, 2022, 2:13am UTC](https://meta.discourse.org/t/is-there-any-endpoint-that-would-provide-a-users-external-account-ids-from-their-discourse-id/218911/11 "2022-03-24T02:13:17Z")

</div>

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