a month ago
I recently renewed the tokens for one of my projects.
I did this a few days ago and was unsuccessful in authenticating. I've now created a new project-scoped token and testing with railway_cli on my equipment, setting the environment variable RAILWAY_TOKEN.
railway -V
railway 4.30.2When I run the command railway status, I receive the following output:
Project: brer
Environment: production
Service: NoneHowever, when I run the following commands, I receive an authentication failure: railway project list
Unauthorized. Please check that your RAILWAY_TOKEN is valid and has access to the resource you're trying to use.When I run the command: railway service status -a
MySQL | 22a559c5-d3c5-49c7-... | STOPPED
Redis | 724bba54-634d-4bab-... | SUCCESS
marketplace | 02a2f278-ae3e-4ba5-... | SUCCESS
api | 9391d464-9639-4078-... | SUCCESS
php-fpm | fd288187-f446-4ee4-... | SUCCESSAnd also testing the commands: railway link ,railway link -s marketplace and railway link -e production -p brer -s marketplace , returning:
Unauthorized. Please check that your RAILWAY_TOKEN is valid and has access to the resource you're trying to use.Please, I need help.
Pinned Solution
a month ago
Works @diogoribeirodev
1. At personal account, create a token, DONT SELECT A WORKSPACE.
Get the token and use it as
RAILWAY_API_TOKEN
11 Replies
a month ago
I'm testing the new version of the CLI, but experiencing the same error.
railway -V
railway 4.30.20x5b62656e5d
Are you using a project scoped token?
a month ago
This token is for the project, not for API.
Scope applies to the API token (I've also encountered this type of issue).
a month ago
railway project list applies to your account not the project itself. Since the token is for the project only, it won't work for neither.
railway status works bc is lists information of the current project.
railway project list , list all projects under your account.
railway list , lists all projects under all of your workspaces.
a month ago
diogoribeirodev
more info https://docs.railway.com/integrations/api#choosing-a-token-type
a month ago
This is not an API token, but rather a project-scoped token.
kamihouse
This is not an API token, but rather a project-scoped token.
a month ago
That is what i said, everything that you’re trying to do, won’t work with a project scoped token ( which itself is an API Token, since it interacts with the railway api, the same a way an account/org scoped token)
Attachments
a month ago
You’re trying to run commands that aren’t available for project scoped tokens, as per the docs i shared above
a month ago
Works @diogoribeirodev
1. At personal account, create a token, DONT SELECT A WORKSPACE.
Get the token and use it as
RAILWAY_API_TOKEN
a month ago
Great!
Status changed to Solved brody • 26 days ago

