I think I have come across a bug in the webhook payloads.
Scenario:
I have set up a “Page” model to be displayed in a tree-like structure and I have the following pages:
A
- B (nested in A)
C
When I drag and drop the page B to be nested in C, like so:
A
C
- B (nested in C)
A webhook with the correct event_type: 'update' fires, but its payload seems to have incorrect data. The new parent ID under entity.attributes.parent_id seems to have an old value, still being the ID of page A. I would expect the ID to be of the new parent, that is page C.
Welcome to the forum and thank you for the report!
Hmm, it looks like if you change the webhook to be on publish instead of update, you should see the correct new parent in the webhook. The update webhook seems to send the current (previous) parent instead of the new one.
I’m not sure if this is a bug, but I’ll report it and double-check for you just in case. I’ll let you know as soon as I hear back.
Thank you for a quick reply, Roger! I found out that moving published pages fires both update and publish webhooks, but draft pages only get the incorrect update webhook, which is unusable.