Does this Slack Webhook still work?

Let's say you've just found something that looks like a Slack incoming webhook URL and want to check if it's active.

The URL may look something like:

https://hooks.slack.com/services/T0.../BF.../fXg...

I've found that sending a request like so is a good way to test validity, as well as let folks know who to get in touch with when they see it:

curl https://hooks.slack.com/services/T0.../BF.../fXg... -d 'payload={"text": "[Notice of leak] Slack Webhook found in source control. Webhook testing by <@jamie.tanna>"}' -i

Or, if this is an arbitrary URL that you're unsure which Slack instance it's connected to, it may be worth adding some contact details to it.

If the webhook is still active, you'll receive an HTTP 200, and if it's no longer valid, you'll receive an HTTP 403.

You may also be interested reading Identify Slack Workspace Names from Webhook URLs.

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #slack.

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.