I tr to create a webhook event for a workflow but can’t continue after sending a test event. There is no error handling, the test event always responses with 202. I also can’t find an official payload documentation. The description " 1. Go to the webhook settings page in the third-party app you want to integrate with." doesn’t help in any way when implementing it in a backend. AI also didn’t gave me a working solution.
My code:
url = 'https://api.hubapi.com/automation/v4/webhook-triggers/1111111/xxxxxxx'
headers = {
'content-type': 'application/json'
}
result = httpx2.post(url, headers=headers, json={
"email": "test-user@example.com",
"first_name": "John",
"last_name": "Doe",
})
print(result.status_code, result.json())
Hi Harald, the thing that trips most people up here is that this trigger has no fixed payload schema. HubSpot builds the schema from whatever JSON your test event contains. The 202 only means HubSpot accepted the request, not that the setup screen captured it.
What I’d check:
- Keep the workflow editor open on the step that shows the webhook URL and waits for the test event, then send your POST. If you closed that panel or started the webhook over, make sure you’re posting to the URL it’s showing now.
- Send flat JSON with Content-Type: application/json, and give every field you’ll need a real sample value. Fields that are null in the test event get left out of the mapping.
- Include a unique ID from your system, like “external_id”: “12345”. On the matching step, that key has to match a HubSpot custom property with “Require unique values” turned on. The workflow only enrolls an existing record that already has that value, so I wouldn’t rely on email as the match key.
Setup reference: knowledge.hubspot.com/workflows/set-when-a-webhook-is-received-workflow-triggers
Since you’re calling from your own backend anyway, the Custom events API (send event occurrence) is a cleaner way to trigger workflows, if your subscription includes custom events.
That I can use any payload is what I remember from the last webhook. And yes, the panel is open and as you see, I use an email as ID. It’s also not working with external_id or simular properties and not with authorization header.
I will contact the support. This seems to be a bug in our account.