Unauthorized error for some accounts




we are experiencing weird issues with two accounts 18ce54hiq69 and 18ce546s18y. When running async jobs to pull metrics we get 401 from time to time. We are unable to reproduce the issue locally, it seems that the oauth headers get sent normally - the response we get is:

  "errors": [
      "code": "UNAUTHORIZED_ACCESS",
      "message": "This request is not properly authenticated"
  "request": {
    "params": {}

Is there something we’re doing wrong? Is there something that could be causing this behaviour on your side? The first occurence of the issue is around June 16th at 20:30 UTC
In the meantime we are investigating logs on our side but we haven’t found anything that could be the cause of the issue as of yet.




Hi @romanrostar!

The error you are receiving makes me think that your request is not properly authenticated. Please follow the steps here for correct OAuth setup. If this is working, then can you hit the GET accounts endpoint to see if those account IDs are returned?


Hey @goforbrent,

the accounts get returned in the response when GETing /accounts. As for the authentication we currently use application level authentication and pass the credentials as a oauth config to the nodejs request library.

All of our calls seem to be authenticated correctly and everything works, even creating a report for the specified accounts, but from time to our backfill jobs fail because they receive 401. We still haven’t found an issue that causes this - it makes me wonder, couldn’t it be that we are getting rate limited somehow (the app id is 13340867)?



Thanks for the additional clarification, @romanrostar. Is this only happening with the POST /1/stats/jobs/accounts/:account_id endpoint?

If it’s a situation where too many jobs are being created, we’d return a TOO_MANY_JOBS error code (400 HTTP status code). If it’s a generic rate limit issue, you should be seeing a TOO_MANY_REQUESTS error code.

We haven’t been able to reproduce this issue, unfortunately. If you have any additional information, please let us know.