# Check user is moderator or not

**URL:** <https://discuss.dev.twitch.com/t/check-user-is-moderator-or-not/31351>\
**Category:** Chat and IRC\
**Created:** [April 19, 2021, 2:04pm UTC](https://discuss.dev.twitch.com/t/check-user-is-moderator-or-not/31351 "2021-04-19T14:04:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kstefgf](https://avatars.discourse-cdn.com/v4/letter/k/dfb087/32.png) [@kstefgf](https://discuss.dev.twitch.com/u/kstefgf)\
**Post date:** [April 19, 2021, 2:04pm UTC](https://discuss.dev.twitch.com/t/check-user-is-moderator-or-not/31351/1 "2021-04-19T14:04:39Z")

</div>

Currently I use following endpoint to determine, that user has moderator status on particular channel or not:  
`https://api.twitch.tv/kraken/users/user_id/chat/channels/channel_id?api_version=5`  
I know that the kraken v5 api is deprecated, but I didn’t find in the docs what is an equivalent tor the new api.

Does anyone know what is new / official endpoint for this query?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [April 19, 2021, 2:05pm UTC](https://discuss.dev.twitch.com/t/check-user-is-moderator-or-not/31351/2 "2021-04-19T14:05:52Z")

</div>

There are two methods

Real the mod badge from chat in real time (great for bot commands)

Or with the broadcasters token you can call “Get Moderators” you will need the `moderation:read` scope applied to the token [https://dev.twitch.tv/docs/api/reference#get-moderators](https://dev.twitch.tv/docs/api/reference#get-moderators)

---

<div class="post-metadata">

**Author:** ![kstefgf](https://avatars.discourse-cdn.com/v4/letter/k/dfb087/32.png) [@kstefgf](https://discuss.dev.twitch.com/u/kstefgf)\
**Post date:** [April 19, 2021, 2:13pm UTC](https://discuss.dev.twitch.com/t/check-user-is-moderator-or-not/31351/3 "2021-04-19T14:13:23Z")

</div>

Thank you! I’ll check it.

---

<div class="post-metadata">

**Author:** ![kstefgf](https://avatars.discourse-cdn.com/v4/letter/k/dfb087/32.png) [@kstefgf](https://discuss.dev.twitch.com/u/kstefgf)\
**Post date:** [April 19, 2021, 2:31pm UTC](https://discuss.dev.twitch.com/t/check-user-is-moderator-or-not/31351/4 "2021-04-19T14:31:54Z")

</div>

I checked this, successfully obtained app access token with moderation:read scope, this is response:

`{"access_token":"........","expires_in":4777185,"scope":["moderation:read"],"token_type":"bearer"}`

but when I try to read from `https://api.twitch.tv/helix/moderation/moderators` I get error:

`401 - "{\"error\":\"Unauthorized\",\"status\":401,\"message\":\"Insufficient authorization in token\"}"`

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [April 19, 2021, 2:32pm UTC](https://discuss.dev.twitch.com/t/check-user-is-moderator-or-not/31351/5 "2021-04-19T14:32:46Z")

</div>

You need a user access token.

![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/d/df9b3d4a87cfb5179da626c791c0a88052e135cd.png)

An App Access token doesn’t have a userID as it doesn’t represent a user.

> [@BarryCarlyon](#):
>
> Or with the broadcasters token

An “App Access Token” is _not_ the broadcasters token

---

<div class="post-metadata">

**Author:** ![kstefgf](https://avatars.discourse-cdn.com/v4/letter/k/dfb087/32.png) [@kstefgf](https://discuss.dev.twitch.com/u/kstefgf)\
**Post date:** [April 20, 2021, 8:10am UTC](https://discuss.dev.twitch.com/t/check-user-is-moderator-or-not/31351/6 "2021-04-20T08:10:27Z")

</div>

You are right, it needs broadcaster token.

> [@BarryCarlyon](#):
>
> Real the mod badge from chat in real time (great for bot commands)

And what about the fist solution? Can I read badges without connecting to a channel?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [April 20, 2021, 11:07am UTC](https://discuss.dev.twitch.com/t/check-user-is-moderator-or-not/31351/7 "2021-04-20T11:07:32Z")

</div>

> [@kstefgf](#):
>
> Can I read badges without connecting to a channel?

In order to read from a channel, you must be in that channel. Otherwise you can’t read.

You could also do `/mods` and parse the response from chat, but again you’d have to `/join` the channel to do so

But if you are working with a streamer, it’s just easier to get authorization

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [May 20, 2021, 11:07am UTC](https://discuss.dev.twitch.com/t/check-user-is-moderator-or-not/31351/8 "2021-05-20T11:07:33Z")

</div>

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