/v1/event/trigger 400 bad request: trigger is missing: actor object
Hello π, my api requests towards the /v1/event/trigger endpoint is returning a
400
error code with the message "trigger is missing: actor object". Looking at the documentation, it mentions that actor is not a required object.
Did anything change in regards to certain properties being required for this particular endpoint?
My payload:
Full response:
Novu
What is Novu - Novu
Novu is a full-stack (UI Components, API, and Framework) open source notification infrastructure platform for building, managing, delivering, and monitoring all types of end-user notifications.
9 Replies
Hi @Willem, I think I see something that might be related. Could it be that your payload includes a key named: actor ?
Hey @Dima Grossman, here's the payload I'm providing:
It does not contain a key "actor".
@Dima Grossman, never mind, I found the issue. In the workflow I defined a particular notification that was expecting actor to be defined. This caused the trigger to respond with a 404400
Oh I see
Glad you resolved it!
Is there some cache mechanism in place for workflows updated in the UI? When I'm hitting the triggers endpoint, it's still giving me back the 400 response. In the UI everything looking good now π
Might be, altho cache should be revoked after updating something there
Are you updating the correct environment?
I double checked and I'm updating and triggering the event from the right environment. I created a minimal reproducible workflow where I have an in-app notification that contains the following copy:
When I call this new trigger with the following payload:
I still get a 400 bad request error indicating that actor should be required.
When I update the in app notification to just contain "hello", the trigger succeeds with the payload without actor defined.
@Willem, you just advanced to level 1!
@Dima Grossman is there any formal way of addressing this problem? It seems that checking for the truthiness of an actor property in the content of a notification is interpreted by the request validation as the actor to be required π₯
Ohhh now I see, i'm not sure if we will be able to extract those conditionals situations. But i'm wondering if we should throw an error on missing subscriber regardless. Do you mind submitting a GitHub issue on the matter so we can discuss it there with the broader team and ocmmunity?