Public
Fire a Slack message into one channel with a single HTTP request
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Fire a Slack message into one channel with a single HTTP request. No event handling, no bot conversation logic — just a tiny sender backed by a bot token.
GET ?text=helloPOSTwith{"text":"hello"}(JSON),text=hello(form), or a raw text body
Everything posts to the single channel set by CHANNEL at the top of main.ts.
- Open this val's HTTP endpoint and click Create the Slack app — the
manifest (a bot user +
chat:write+channels:join) is prefilled. Then Install to Workspace. - Copy the Bot User OAuth Token (
xoxb-…) into theSLACK_BOT_TOKENenv var. - Set
CHANNELat the top ofmain.tsto your channel's ID — open the channel in Slack and grab theC…from the URL (or View channel details → Channel ID, copy button at the bottom). - (Optional) Set
WEBHOOK_SECRETto require?key=…on every call. Leave it blank to keep the endpoint open.
- Public channels the bot isn't in are auto-joined on the first send.
Private channels and DMs must invite it first (
/invite @webhook-pinger). - The channel is hardcoded on purpose — a caller can't redirect the message somewhere it shouldn't go.
- Grow it: this is a send-only base with room to climb. Add scopes to the
manifestinmain.tsand re-create the app to unlock threads (thread_ts), Block Kit attachments, reactions, multiple channels, or even inbound events.