10 months ago
This is failing with NOT AUTHORIZED:
curl -s -X POST https://backboard.railway.app/graphql/v2 \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"query": "query { me { projects { edges { node { id name services { edges { node { id name } } } } } } } }"}'
even though I am using a user-scoped token I created here:
https://railway.com/account/tokens
For what it's worth I'm still a trial account. Does that matter?
Pinned Solution
10 months ago
the issue is your query path doesn't exist. you can't do me { projects { ... }}. you need to query through workspace instead:
bash
curl -s -X POST https://backboard.railway.app/graphql/v2 \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"query": "query { workspace(workspaceId: \"YOUR_WORKSPACE_ID\") { projects { edges { node { id name services { edges { node { id name } } } } } } } }"}'get your workspace id by hitting cmd/ctrl + k in the dashboard and searching "copy active workspace id"
trial accounts have full api access so that's not the problem
3 Replies
10 months ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 Can't use Railway Public API with Project Token (projectToken null / Not Authorized)
- 🧵 I cannot access either Railway API or CLI with API Token
- 🧵 use railway api to create service in project?
If you find the answer from one of these, please let us know by solving the thread!
10 months ago
the issue is your query path doesn't exist. you can't do me { projects { ... }}. you need to query through workspace instead:
bash
curl -s -X POST https://backboard.railway.app/graphql/v2 \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"query": "query { workspace(workspaceId: \"YOUR_WORKSPACE_ID\") { projects { edges { node { id name services { edges { node { id name } } } } } } } }"}'get your workspace id by hitting cmd/ctrl + k in the dashboard and searching "copy active workspace id"
trial accounts have full api access so that's not the problem
Status changed to Solved brody • 10 months ago
