Creating a Webhook - answer with a 200 code to confirm webhook notifications

Hi Community,

I am currently in the process of creating a Webhook and the app I am accessing uses immediate confirmation which requires me to return a 200 code to confirm I want to receive Webhook notifications. How do i go about returning this 200 code? The app I am using sent a POST request to me with a random secret included in the header. It then wants me to return this secret as a header in a 200 code response.

I do not understand how I return this 200 response code, do I need to use a HTTP request?

Any help would be much appreciated!

Thanks Everyone!

You need the webhook node using Response Mode: Last Entry. Connect the webhook node to a set node and return the secret in the format needed. You can also use a function node but the set node should be just fine.

1 Like

Hi Ricardo,

Could I not use the header response option built into the webhook node? Or is that for something else

Thanks

Ahh, on the header, I missed that. Sadly that is not possible.

I thought this was updated in the latest update of n8n

Do not see it in the changelog. Where did you see that?

Yes, you can respond with a header but cannot reference the header dynamically, which is what you need to do. If the header were a fixed value, this would work.

1 Like

Ahhh i understand. So currently there is no way for me to respond with a dynamic header?

Is there a way for me to send back the header in a different node? The webhook is open for 72 hours before becoming inactive so I wouldn’t need to send a response immediately.

Sadly not. At least not using only n8n.

1 Like

Ok thanks for the help. Is this something I could make a feature request for?

You can upvote this one and explain your use case. That would definitely help.

1 Like