I want to validate some comments with the AutoMod and I saw that I can use the Check AutoMod Status method. I try to do this using an app. I’ve gone trough the following steps:
Create an app get client_id and client_secret
Get a CODE using
https://id.twitch.tv/oauth2/authorize, redirect to localhost set scope to moderation:read. Copy the CODE and use it to generate an ACESS_TOKEN using
Copy the ACESS_TOKEN and try to use it to Check AutoMod Status here
Can you please tell me what am I doing wrong?
You did call this API with a token from the broadcaster
Reference | Twitch Developers
broadcaster_id must match the
user_id in the auth token.
So do do a “check” on Ninja’s channel you need a token from Ninja
To do a “check” on Lirik’s channel you need a token from Lirik.
I’m guessing you mean the second step “Get a CODE using
https://id.twitch.tv/oauth2/authorize” where a manual action is needed to grant permission. Here I just allow it for my channel which is the same as braodcaster_id
Can you show the full request you are making to the status API (with token redacted)
I do not quite understand what you mean, sorry
I don’t have any code yet, I’m just using a REST client
POST https://api.twitch.tv/helix/moderation/enforcements/status?broadcaster_id=<broadcaster_id> HTTP/1.1
Authorization: Bearer <access_token>
"msg_text": "there was a time",
Looks like it’s broken.
if I call with a “incorrect” broadcaster_id I get a 403
If I call with a “correct” broadcaster_id I get a 500
Reporting issue now
This means I have the wrong broadcaster_id ? I put my twitch username there. I tried with the numerical ID but still “Forbidden”.
All I can tell you is that it’s completely broken.
Added my findings to
03:28PM - 25 Nov 21 UTC
12:37PM - 28 Nov 21 UTC
Currently `Check AutoMod Status` is broken.
Thanks man! I guess I’ll just follow the issue
Also, the example for Check AutoMod Status in the docs does not include a broadcaster_id:
Reference | Twitch Developers. Just sayin’
some_user_id a real user ID if it’s not then you get an unexpected result (500)
broadcaster_id in the URL doesn’t match the user ID in the token you get a 403.
So we need to debug your issue further
Yes, the some_user_id is a real id, and the broadcaster_id is the one who allowed the code generation at step 2.
Then I’m not sure why it’s not working for you.
I retested the API with real data and it’s working fine for me. My initial mistake was using the user ID from the example in the docs which is a dead user
If I run
"msg_text": "Hello World!",
I get the expeceted result
My tokens validate output
https://barrycarlyon.github.io/twitch_misc/examples/token_checker/ to check
So all I can see is it’s working as expected here
So we need to work thru your steps further.
This being my rest clients (insomnia) test output.
Ok, I tested, and it worked for me also. The problem was that I didn’t use a numerical “user_id” and “broadcaster_id”. I thought that user_id refers to the author of the message, not the broadcaster.
Thanks a lot!
Yeah that’ll do it
Err it does, you just have to use the ID of the user not the users login.
The screenshots I used above are a bad example as I used my own ID in both.
So Practical example:
You want to test that a message of
Hello World! from
noylraCyrraB that is to be tested against the AutoMod on channel
The URL is
And the headers contain a token for
And the JSON POST body is
"msg_text": "Hello World!",
As a message from the broadcaster in the broadcasters own channel will always pass automod.
Thanks a lot man! It works like a charm