Railway API Token Permissions Issue
appsgenerated-wq
FREEOP

5 months ago

Hi! I'm getting a 400 "Problem processing request" error when trying to create services via the GraphQL API.
What works:
✅ Project access: { project(id: "f942a2cc-2975-4d34-9083-zzzzzzzzzzzzz") { id name } } returns successfully
✅ API token authentication works
What fails:
❌ User API: { user { id name email } }
❌ Services API: { project(id: "…") { services { id name } } }
❌ Service creation: serviceCreate mutation
Error: {"errors":[{"message":"Problem processing request","traceId":"…"}]}
Question: Do I need a different token type (Account vs Project token) or different permissions to create services? The current token can access the project but seems to have limited scope.
Project: luminous-edtion (f942a2cc-2975-4d34-9083-dzzzzzzzzz8c)

Thanks for reading!

Solved$20 Bounty

78 Replies

5 months ago

Account token or project token should work here. Do you have multiple environments in this project?


5 months ago

Which are you using btw, account or project


appsgenerated-wq
FREEOP

5 months ago

1420237841258254300


appsgenerated-wq
FREEOP

5 months ago

i generated token from account settings


appsgenerated-wq
FREEOP

5 months ago

im developing a no code application which should deploy the backend to railway.

the repos are successfully built, but im having trouble auto deploying to railway.


5 months ago

Have you tried using a project scoped token instead? Just to test.


appsgenerated-wq
FREEOP

5 months ago

is this only for paid version?


appsgenerated-wq
FREEOP

5 months ago

1420238309770137600


appsgenerated-wq
FREEOP

5 months ago

clicking verify account takes you to plans page


5 months ago

@Error


5 months ago

@gabriel Do NOT click that.


5 months ago

Well hmmm


5 months ago

This is on Railway? That's some crazy contrast for a Railway page.


appsgenerated-wq
FREEOP

5 months ago

its the hdr from my screen shot


5 months ago

Hey Gabriel!
Do you have any themes or extensions on to modify the colors? Looks a bit off


appsgenerated-wq
FREEOP

5 months ago

1420238737287155700


5 months ago

Tokens can be created per project in the project settings

1420238752034328600


5 months ago

Want to make sure you arent entering sensitive information anywhere other then railway 😁


5 months ago

Ah. I guess it is required to verify for this.


5 months ago

Verification shouldn't charge you anything


appsgenerated-wq
FREEOP

5 months ago

it doesnt take me to a verify page.


appsgenerated-wq
FREEOP

5 months ago

where do i verify?


5 months ago

Where does it take you?


appsgenerated-wq
FREEOP

5 months ago

1420239036949463000


5 months ago

🤨


5 months ago

Hmm


appsgenerated-wq
FREEOP

5 months ago

haha maybe slight routing issue


5 months ago

yeah that is weird.


appsgenerated-wq
FREEOP

5 months ago

better screenshot if it helps


appsgenerated-wq
FREEOP

5 months ago

1420239226217304000


appsgenerated-wq
FREEOP

5 months ago


5 months ago

this happens when Railway deems your github account too suspicious to allow you to host code on it freely

Looks like you may need to upgrade


5 months ago

Looks like limited trials cant create project tokens


5 months ago

I asked on your behalf and found out that Railway has given exceptions to this rule before, and I'm sure Railway would be happy to support your needs. On that note, I recommend you email billing@railway.app from the email you use on Railway and explain your use case and the problem you're facing and they might be able to help you.

You can email them if you need. But regardless account tokens should totally work


5 months ago

Can you share your exact GraphQL request?


appsgenerated-wq
FREEOP

5 months ago

Our GraphQL request:
mutation CreateService($input: ServiceCreateInput!) {
serviceCreate(input: $input) {
id
name
}
}
Variables:
{
"input": {
"projectId": "f942a2cc-2975-4d34-9083-d594cd07e48c",
"name": "no-code-app-8bb7d85c-ddac-4b00-b6de-2ad1cb4c3d23",
"type": "WEB_SERVICE"
}
}
Headers:
Authorization: Bearer [token]
Content-Type: application/json


appsgenerated-wq
FREEOP

5 months ago

maybe for context. im building no code application. i currently have generations going to repos and i need to host the backend for each corresponding repo.


5 months ago

Testing on my own


appsgenerated-wq
FREEOP

5 months ago

i may not be doing this in the ideal fashion either if you have tips


appsgenerated-wq
FREEOP

5 months ago

i tried the cli first, but i didnt have success


5 months ago

Just looks like your request is a little borked


appsgenerated-wq
FREEOP

5 months ago

i have it setup for render, but have limitation that i cannot make hosting for each repo without paying (they limit to one). i honestly dont want to pay unless i actually plan to release it

i cannot use a multi tenat structure with what im using for the generated backends


5 months ago

Sending you the correct one


5 months ago

mutation serviceCreate {
  serviceCreate(
    input: {
      projectId: "7f46c0f9-0597-4cc4-887d-b4e34923a37b"
      source: { image: "postgres" }
      name: "Hello world"
    }
  ) {
    id
  }
}

Here you go! You can see where I set the image, you can change that to repo to be a source link. Name and projectId are a given. No query variables required.


5 months ago

@gabriel ^^


appsgenerated-wq
FREEOP

5 months ago

Thank you! 🙏

got past the mutation structure issue, but now hitting a new 400 error during service creation. The logs show our request is correct but Railway returns a generic "Problem processing request" error with no details.

Our request:
mutation serviceCreate {
serviceCreate(
input: {
projectId: "f942a2cc-2975-4d34-9083-zzzzzzzzREMOVEDzzzzz"
source: {
repo: "https://github.com/………….REMOVED"
rootDirectory: "backend"
}
name: "no-code-app-xyz"
}
) { id }
}

Error: {"errors":[{"message":"Problem processing request","traceId":"3755196274180473766"}]}

Repository is public, has frontend/, backend/, README.md structure

I think the generic err could be because im not verified/paid user?


5 months ago

It's because rootDirectory isn't actually a valid option


appsgenerated-wq
FREEOP

5 months ago

source: { repo: "railwayapp-templates/django" }

Do I just add /backend like this?


5 months ago

No… I'm trying to figure out how to do this


5 months ago

mutation updateService {
  serviceInstanceUpdate(
        serviceId: "service-id",
        input: {
            rootDirectory: "directory"
        }
  ) 
}

You'll have to do it in two requests


5 months ago

Not sure why that spacing got all weird but


5 months ago

You get it


appsgenerated-wq
FREEOP

5 months ago

sorry for the late response, i dont believe that it working


5 months ago

What's not working with it?


appsgenerated-wq
FREEOP

5 months ago

am i setting the root dir correctly?
mutation updateService {
serviceInstanceUpdate(
serviceId: "ea40ba6e-bd1b-4221-a4b9-d9ZZZZZZZ534",
input: {
rootDirectory: "backend"
}
) {
id
}
}


5 months ago

Yep, it works for me. Are you sure you're using the service ID and not the project ID?


5 months ago

1420510523761627100


appsgenerated-wq
FREEOP

5 months ago

where in the docs did you find to use this
mutation updateService {
serviceInstanceUpdate(
serviceId: "service-id",
input: {
rootDirectory: "directory"
}
)
}


appsgenerated-wq
FREEOP

5 months ago

const createMutation = mutation serviceCreate { serviceCreate( input: { projectId: "${this.projectId}" source: { repo: "${repoPath}" } name: "${serviceName}" } ) { id } } ;

const updateMutation = `
  mutation updateService {
    serviceInstanceUpdate(
      serviceId: "${serviceId}",
      input: {
        rootDirectory: "${rootDir}"
      }
    ) {
      id
    }
  }
`;

const mutation = `
  mutation SetEnvironmentVariables($input: ServiceEnvironmentVariablesInput!) {
    serviceEnvironmentVariables(input: $input) {
      id
      name
    }
  }
`;

5 months ago

I looked at the schema



appsgenerated-wq
FREEOP

5 months ago

ok it does work like this const updateMutation = mutation updateService { serviceInstanceUpdate( serviceId: "${serviceId}", input: { rootDirectory: "${rootDir}" } ) } ;


5 months ago

That should work, yes


appsgenerated-wq
FREEOP

5 months ago

the issue is now the env var one <:mildpanic:804271964587819059>


5 months ago

Where did you get the method you’re using from?


appsgenerated-wq
FREEOP

5 months ago

chatting with copilot


5 months ago

Well hopefully this is a lesson


5 months ago

I’m scrolling through possible methods on the actual docs right now, you can too


5 months ago

VariableCollectionUpsertInput

I believe this is what you need to use


appsgenerated-wq
FREEOP

5 months ago

yes ive been using the docs, but they are kinda brief tbh


5 months ago

The documentation’s hyperlinking is broken but you can find it in the playground



appsgenerated-wq
FREEOP

5 months ago

oh i see now. thank you!


5 months ago

Is this issue good to be marked as solved?


appsgenerated-wq
FREEOP

5 months ago

[SERVER] Response: {"error":"Generation failed","message":"App deployment failed: Failed to create Railway web service: Railway GraphQL error: Your account is on a limited plan. Please visit railway.com/account/plans for details."}

yea seems its not going to work as the free plan though, going to reach out to billing@railway.app


appsgenerated-wq
FREEOP

5 months ago

i appreciate your responses. do you work for railway?


5 months ago

Yep, if that's your error then you'll have to do that.


5 months ago

I do nopt


Status changed to Solved noahd 5 months ago


Loading...