How can I set the access token for the admin api?

Hi @martaver,

By default, to call /admin API, no access token is required.

In case, authentication has been setup by providing --auth_token flag while running dgraph alpha, the same token needs to be provided for admin operations using auth_token flag.
For details regarding authentication: https://dgraph.io/docs/deploy/dgraph-administration/#securing-alter-operations

Another reason could be IP whitelisting. By default, admin operations are allowed from the same machine on which dgraph alpha runs. If you are running admin operations from a different machine, make sure that the IP has been whitelisted.
For more details: https://dgraph.io/docs/deploy/dgraph-administration/#whitelisting-admin-operations