Stream API 10000 Error

Stream API: Linked to an old post below and am currently having the same issue. Getting a 500 response that says error code 10000, “Authentication error”. However, like the forum post I linked to I’m 100% sure my token is valid (I test it in a preceding request using the tokens/verify endpoint) and the token has permissions for read + edit Stream (along with the whole read permissions template). The other post did seem to get it to work with the legacy global API, but I’ve had no such luck. (Also, since the doc examples) use Authorization it should work) Considered it being a permissions issue and added all the ones I think could possibly be related to it but still nothing.

Any advice or words of wisdom? Thank you!

// here's a snippet of what my code looks like...
    const init = {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Authorization: `Bearer ${headers.get("authorization")}`,
      },
    };
    const response = await fetch(
      "https://api.cloudflare.com/client/v4/accounts/" +
        headers.get("userid") +
        "/stream/live_inputs",
      init
    );
    const body = await gatherResponse(response);

Here’s what it returns:

Can’t add links for some reason but here it is:
https:// community.Cloudflare .com/t/Cloudflare-stream-10000-authentication-error/149227

Hi, do you get the same error if you use a client like Insomnia to make a request?

Hi! Yes, unfortunately. Here’s a screenshot of it in Postman. Thanks for the reply!

My account ID is the top covered value and token key is the bottom covered value.

Thanks. Just dropped you an email.

1 Like

Fixed: Thank you @zaid for your help! The API requires you to use the Account ID. I was mistakenly using the User ID instead. You can find the accounts available to a user by using this endpoint: https:// api.Cloudflare .com/client/v4/accounts and then using the ID associated with the account.

1 Like

Hi, I’m having similar problems but I’m already using Account ID and this happens only occasionally, like 2-3 times a month. It works most of the time so I’m not sure why I’m getting this.