2 months ago
curl --request POST --url https://backboard.railway.com/graphql/
v2 --header "Authorization: Bearer XXXXXXXXXXXXX" --header "Content-Type: application/json" --data '{
"query": "mutation DeployPostgres($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
"variables": {
"input": {
"projectId": "XXXXXXXXXXXXXXXXXXXXXX",
"environmentId": "XXXXXXXXXXXXXXXXXXXX",
"code": "postgres",
"serializedConfig": {}
}
}
}'
{"errors":[{"message":"Problem processing request","traceId":"7018428193132959909"},{"message":"Problem processing request","traceId":"7018428193132959909"}]}
2 Replies
2 months ago
I was able to get a successful curl response by modifying what you have supplied here. It seems like a few of the parameters were possibly incorrect:curl --request POST --url https://backboard.railway.com/graphql/v2 --header "Authorization: Bearer xxxxx" --header "Content-Type: application/json" --data '{"query": "mutation templateDeployV2($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }","variables": {"input": {"projectId": "xxxxxx","environmentId": "xxxxx","templateId": "postgres","serializedConfig": "{\"POSTGRES_DB\":\"railway\",\"POSTGRES_USER\":\"postgres\",\"POSTGRES_PASSWORD\":\"password\"}"}}}'
For example, the "code" should be "templateId". This gives me a successful curl response with the expected data.
You should replace your bearer token, your projectId, and your environmentId here. Similarly, if you don't want to specify any serializedConfig you don't have to. According to: https://railway.com/graphiql the seralizedConfig expects a stringified JSON object, hence why there are quotes around the braces ("{}").
Let me know if this works for you.