Is this not possible or am I missing something? Predictions EndPoint

I’m following the documentation from Prediction | Twitch Developers So I created an application and with it’s client id and secret I’m redirecting the user to login at:

With the corresponding client id and redirect url.

With the response I request an access token by doing a POST to:

with the CODE been the code received in the previous step.

With this access token I then do a POST like this (REST Client)

Authorization: Bearer {{token}}
Client-Id: {{clientId}}
Content-Type: application/json

	"broadcaster_id": "___",
	"title": "Test prediction",
	"outcomes": [{ "title": "Option 1" }, { "title": "Option 2" }],
	"prediction_window": 300

ClientId is my application client id and token is the access token we got in the previous steps. Broadcaster ID is the ID of the broadcaster account I’m a moderator for (maybe this is the key to the issue) When sending this post I get back.

  "error": "Unauthorized",
  "status": 401,
  "message": "The ID in broadcaster_id must match the user ID found in the request's OAuth token."

I’m assuming that only a broadcaster himself can use this endpoint? But if that’s the case why it would even ask for a broadcaster id?

Is it not possible to a moderator to use this endpoint?


The list is many for why this is the case. TLDR: it helps you make sure you are talking to the right persons data.

1 Like

Thanks Barry. Will try to test with some boilerplate responses and then send to the broadcaster for him to test.

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