Skip to content
Documented project-token query returns HTTP 403 from GitHub Actions
rogandev
OP

a month ago

A read-only Python workflow on a GitHub-hosted runner receives HTTP 403 when posting this documented query to https://backboard.railway.com/graphql/v2:

query { projectToken { projectId environmentId } }

The workflow uses an existing project token through GitHub’s encrypted secret injection and Railway’s documented authentication method. A separate service query was removed to isolate this minimal test; it still returns 403.

No credentials or response bodies are logged. Retries have stopped, and no deployment or mutation was attempted.

Is there a documented request requirement or known restriction that explains HTTP 403 for this minimal query?

$10 Bounty

4 Replies

Status changed to Awaiting Railway Response Railway • about 1 month ago


sam-a
EMPLOYEE

a month ago

That query is the right one for a project token, and it has to be sent with the token in a Project-Access-Token header, not Authorization: Bearer.

A wrong header, a mistyped token, or a deleted token doesn't cause an HTTP 403, though. The API accepts those requests and answers with HTTP 200 and a "Not Authorized" error in the response body. Going over the rate limit returns HTTP 429.

So the 403 your runner gets doesn't match how the API itself rejects a project token. The response body is the quickest way to tell where the 403 comes from, so logging just that body (not the request headers) for one run is worth doing.


Status changed to Awaiting User Response sam-a • about 1 month ago


rogandev
OP

a month ago

The read-only diagnostic returned HTTP 403 with error 1010. Could you confirm the supported client/request configuration for this API call?


Status changed to Awaiting Railway Response Railway • about 1 month ago


Railway
BOT

a month ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway • about 1 month ago


a month ago

I can't reproduce it, Tried curl locally and Python in Github action both returns 200, Could you share your current setup?


mamboitaliano21

a month ago

Hi All,

First of all it's my first contribution here so I apologize if I break any rules.

I managed to reproduce the same 403 / Cloudflare error 1010 with curl. Changing only the User-Agent header allowed the request to reach Railway’s GraphQL API.

First, using the default User-Agent sent by urllib on Python 3.14:

curl -i -sS --max-time 25 \
  'https://backboard.railway.com/graphql/v2' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -A 'Python-urllib/3.14' \
  --data '{"query":"{ projectToken { projectId environmentId } }"}'

Response:

HTTP/2 403

error code: 1010

Then, the same request with an explicit application User-Agent:

curl -i -sS --max-time 25 \
  'https://backboard.railway.com/graphql/v2' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -A 'RailwaySupportDiagnostic/1.0 (curl; unauthenticated control)' \
  --data '{"query":"{ projectToken { projectId environmentId } }"}'

Response:

HTTP/2 200

{"errors":[{"message":"Project Token not found","locations":[{"line":1,"column":3}],"path":["projectToken"],"extensions":{"code":"INTERNAL_SERVER_ERROR"},"traceId":"3840964166595508563"}],"data":null}

Neither request included a token, so "Project Token not found" is expected. It confirms that the second request reached Railway’s API rather than being rejected at Cloudflare.

-A is curl’s --user-agent option. In your existing client, set the User-Agent header to identify your application, while keeping the Project-Access-Token header:

request.add_header("User-Agent", "your-app-name/1.0")

If you're using urllib, its default User-Agent includes the Python version—for example, Python-urllib/3.14, which triggered the rejection in this test.

Cloudflare documents error 1010 as rejection based on the client’s signature. Railway can review the Cloudflare security configuration responsible for it; the exact rule isn't visible from these responses.

Could you try the explicit User-Agent in your workflow and confirm whether it removes the 1010 response?

Disclaimer: Reply written using AI, I have verified the reply above manually.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...