Web API - Invalid origin

Following the https://docs.sentry.io/api/, I’m trying to fetch stats for a particular team as described at https://docs.sentry.io/api/teams/get-team-stats/

On hitting the endpoint, I’m getting 400 BAD REQUEST , with the response as: Invalid origin: http://localhost:8001

Code snippet:

    fetch( fetchURL,{
        method: 'GET',
        headers: {
            'Content-Type': 'application/json',
            'Authorization': 'Bearer <token>'

You need to configure allowed domains / origins within your token settings.

@zeeg hello!
I faced the same problem.
In project “Allowed Domains” is “*”
Example with curl:

curl -H 'Authorization: Bearer xxxxxxxxxx' -H "Origin: https://mydomain.com" http://localhost:9000/api/0/projects/sentry/external-sdk/
 "Invalid origin: https://mydomain.com"

I don’t understand how to configure allowed domains / origins within token settings.
Could you explain?