API token doesn't work
kkeril
HOBBYOP

25 days ago

I've issued API token but it doesn't work. I've tried multiple times - same result every time

Request
curl -X POST https://backboard.railway.com/graphql/v2 \

-H "Authorization: Bearer MY_TOKEN_WAS_HERE" \

-H "Content-Type: application/json" \

-d '{"query": "query { me { name email } }"}'

Response

{

"errors": [

{

"message": "Not Authorized",

"locations": [

{

"line": 1,

"column": 9

}

],

"path": [

"me"

],

"extensions": {

"code": "INTERNAL_SERVER_ERROR"

},

"traceId": "6494686156277782800"

}

],

"data": null

}

Solved$10 Bounty

Pinned Solution

Try only setting RAILWAY_API_TOKEN as the token is account scoped. Remove RAILWAY_TOKEN, as that is for project scoped tokens.

https://docs.railway.com/cli#tokens

9 Replies

Are you using a scoped token instead of an account-wide token?


kkeril
HOBBYOP

25 days ago

I took one from here . Which one is it ?

Attachments


Click on the Workspace dropdown, and select No Workspace.


This one

Attachments


kkeril
HOBBYOP

25 days ago

Thanks!

It worked via curl, but keep failing via MCP

«Railway MCP check failed: Railway CLI is present, but auth is invalid/expired.»

Attachments


What do you mean by auth is invalid or expired?


kkeril
HOBBYOP

25 days ago

This is what codex told me, when I asked him to check Railway MCP

here is a part from config.toml related to Railway
«
[mcp_servers.railway]

command = "npx"

args = [ "-y", "@railway/mcp-server" ]

startup_timeout_sec = 30

tool_timeout_sec = 120

[mcp_servers.railway.env]

RAILWAY_API_TOKEN = "MY_TOKEN_NO_WORKSPACE_HERE"

RAILWAY_TOKEN = "MY_TOKEN_NO_WORKSPACE_HERE"»

the config was generated by Codex based on the https://github.com/railwayapp/railway-mcp-server


Try only setting RAILWAY_API_TOKEN as the token is account scoped. Remove RAILWAY_TOKEN, as that is for project scoped tokens.

https://docs.railway.com/cli#tokens


kkeril
HOBBYOP

24 days ago

It helped! Thank you!


Status changed to Solved brody 24 days ago


Loading...