Twitch Subscription API Error 400

Upon using the API POST it only returns error 400 even though all field is correct. Please help check. Thank you.

async  function registerEventSubListeners() {


  
    const response = await     fetch('https://api.twitch.tv/helix/eventsub/subscriptions', {
      method: 'POST',
      headers: {
          "Content-Type": "application/json",
          "Authorization": "Bearer " + OAUTH_TOKEN,
          "Client-Id": CLIENT_ID
     },
      body: JSON.stringify({
        "type": "user:read:chat",
          "version": "1",
          "condition": {
            "broadcaster_user_id": CHAT_CHANNEL_USER_ID,
            "user_id": CHAT_CHANNEL_USER_ID
        },
        "transport": {
            "method": "websocket",
            "session_id": websocketSessionID
        }
    })

  })

Whats the body message of the response?

The HTTP Code is half the information
The body will describe the error

console.log(response.status, await response.text());

this isn’t a valid eventsub type, it’s a scope, did you mean channel.chat.message

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