Hi @Phil_Seeman and @nocodeventure,
You should be able to see project deleted events if you establish a webhook at the domain/workspace level with the project deleted filter.
EX:
{
"data": {
"resource": "<WORKSPACE_GID>",
"target": "<TARGET_URL>",
"filters": [
{
"resource_type": "project",
"action": "deleted"
}
]
}
}
@Phil_Seeman I think you are right about your assumption:
“I guess that makes logical sense - I suppose it can’t send a webhook for a project which no longer exists? - but then how can we know when a user deletes a project via the UI?”
I tried two things:
1: Established a webook at the project level and deleted that project
EX: This webhook essentially shows all events that happens in a project
{
"data": {
"resource": "<PROJECT_GID>",
"target": "<TARGET_URL>"
}
}
Result = no webhook deleted event for project → I think this makes sense from @Phil_Seeman’s reasoning
2: Establish a webhook at the domain/workspace level and use the filter to filter out for project deleted events. Then deleted a project in that domain/workspace.
EX:
{
"data": {
"resource": "<WORKSPACE_GID>",
"target": "<TARGET_URL>",
"filters": [
{
"resource_type": "project",
"action": "deleted"
}
]
}
}
Result = webhook event for project being deleted
EX: sample event
[
{
"user": {
"gid": "<USER_GID>",
"resource_type": "user"
},
"created_at": "2024-01-03T16:00:24.970Z",
"action": "deleted",
"parent": null,
"resource": {
"gid": "<DELETED_PROJECT_GID>",
"resource_type": "project"
}
}
]
@Phil_Seeman to further confirm your hypothesis I tried: Establishing a webhook at the task level and deleting the task resource that the webhook was created with.
EX:
{
"data": {
"resource": "<TASK_GID>",
"target": "<TARGET_URL>"
}
}
Result = same as #1 for project webhook. I did not get any task deleted events back about the task that the webhook was established under.
In conclusion, I think your hypothesis about “can’t send a webhook for a project which no longer exists” is right.