a month ago
We have an OAuth-based deployment flow that previously worked but now fails when creating a project token.
GraphQL endpoint:
https://backboard.railway.com/graphql/v2
Granted OAuth scopes:
openidemailprofileoffline_accessworkspace:admin
Deployment flow (GraphQL operations):
meprojectCreateserviceCreateprojectserviceDomainCreatevariableCollectionUpsertprojectTokenCreaterailway up
The OAuth access token successfully executes every GraphQL operation through variableCollectionUpsert. The failure only occurs when calling projectTokenCreate.
mutation projectTokenCreate($input: ProjectTokenCreateInput!) {
projectTokenCreate(input: $input)
}Payload:
{
"input": {
"projectId": "project-id",
"environmentId": "environment-id",
"name": "app-deploy"
}
}Response:
Error: Railway GraphQL error: Not AuthorizedThe returned project token is used to deploy with:
RAILWAY_TOKEN=<token> railway up \
--project <project-id> \
--service <service-id> \
--environment <environment-id> \
--detachIs projectTokenCreate still expected to work with a workspace:admin OAuth token, or has the supported deployment flow for OAuth apps changed? If it has changed, what is the recommended deployment flow for applications deploying on behalf of a user?
1 Replies
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
projectTokenCreate is intentionally blocked for OAuth tokens, regardless of scope. A project token is a long-lived credential that would outlive the OAuth grant that created it (revoking the OAuth app would not delete the project token), so this is a deliberate security boundary. The recommended alternative is to call serviceInstanceDeployV2 directly with your OAuth access token as the Bearer token, which works with workspace:member scope or higher and returns a deployment ID you can poll.
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • about 1 month ago