2 years ago
Can we create webhook on a particular project using the Public API key?
I tried re-creating my api key but no use, I also create API token for individual project and also no use.
Error Message:
{
"errors": [
{
"message": "Not Authorized",
"locations": [
{
"line": 8,
"column": 3
}
],
"path": [
"webhookCreate"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
],
"data": null
}37 Replies
2 years ago
Any update? We really need this to provide our application as SAAS to our end users. Vercel is providing this feature though.
2 years ago
adding webhooks works just fine, you might be trying to use the wrong api key

hey @Brody , I'm created a team and created another project within it and would like to add webhook to it.
All other queries like create project, redploy or template deploy are working with my api but not the webhook, any idea what's getting wrong?
Also, I need to create the API token in my personal account right? I was not able to create any api token in my team workspace
2 years ago
you need to create the API token for the team account
2 years ago
select your hobby account and then select the team when creating a token
2 years ago
what is your status on the team
2 years ago
you may have to ask the owner to create the API token for you
2 years ago
please show me the errors
This is the request:
mutation createWebhook {
railway {
webhookCreate(input: {projectId: "19f097bd-c834-48f1-b55e-50123c01f982", url: "https://webhook.site/ba79d712-b3b4-4221-a5d5-3acf9ff296f7"}) {
id
lastStatus
projectId
url
}
}
}This is the response
{
"data": null,
"errors": [
{
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
},
"locations": [
{
"column": 26,
"line": 1
}
],
"message": "Not Authorized",
"path": [
"webhookCreate"
]
}
]
}Just created a new empty project, and new API token and tested it out
Even tried creating a project token and used it for creating webhook, but facing the same issue
2 years ago
try using a "No Team" token
2 years ago
i was able to replicate this issue using a team token, if i use a "no team" token i am able to add webhooks to pro projects that im a part of
Nice, I was able to replicate it and create webhook. But don't you think it is not the desired way?
2 years ago
if it works it works 🙂
Seems like the personal tokens are throwing errors now, but a new error message:
{
"errors": [
{
"message": "Nice try. Psst, we have a bug bounty! See the Discord",
"locations": [
{
"line": 2,
"column": 5
}
],
"path": [
"webhookCreate"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
],
"data": null
}2 years ago
have you tried using the team token?
2 years ago
can you add a webhook via the dashboard?
2 years ago
if you can add a webhook via the dashboard you can do so via the API as well
But, using the public API, I was not able to create webhook using both the teams API token or the Personal Token.
Am I missing something here, based on our previous conversation, I was able to create webhooks using personal token, but now I was not able to create using them.
Error with team token:
{
"data": null,
"errors": [
{
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
},
"locations": [
{
"column": 26,
"line": 1
}
],
"message": "Not Authorized",
"path": [
"webhookCreate"
]
}
]
}The error with personal token.
{
"errors": [
{
"message": "Nice try. Psst, we have a bug bounty! See the Discord",
"locations": [
{
"line": 2,
"column": 5
}
],
"path": [
"webhookCreate"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
],
"data": null
}no issues, I guess using url to be localhost is getting me the error.
In order to create webhook with Public API.
use personal token (even though the project is in a team)
the URL, cannot he
[http://localhost:3000](http://localhost:3000)
2 years ago
may I ask why you thought localhost would work?
2 years ago
okay
10 months ago
Hi. I have the same error, any update?
```json
mutation {
webhookCreate(input: { projectId: "b614efeb-846a-41a7-9895-e437d0c4d38d", url: "https://.../webhook/railway_status_change" }) {
filters
id
lastStatus
projectId
url
}
}
```
```json
{
"errors": [
{
"message": "Not Authorized",
"locations": [
{
"line": 57,
"column": 3
}
],
"path": [
"webhookCreate"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
},
"traceId": "274704726056642564"
}
],
"data": null
}
```
It is not a matter of the API Key, with that same API Key I have created projects, launched services etc...
