relayhook.io

Stateless webhook middleware


With nothing but a URL, transform your outgoing webhooks before they reaching their final destination.

Get started for free

Webhooks are great when you're sending them to a service you own, but what happens when you want to connect two third-party services to eachother?

Sure, IFTTT, Zapier, and the like have their place, but sometimes you want something just custom enough.

relayhook is middleware for webhooks. You point your webhook at a relayhook url and it transforms the webhook and forwards it on to your destination.

Let's say you want to send a message to a slack channel everytime someone opens a GitHub issue (sure, in this case you should probably just use the slack/github integration, but this makes for a nice example)

GitHub sends you this

{
  "action": "opened",
  "issue": {
    "number": 2,
    "title": "Spelling error in the README file",
    "user": {
      "login": "baxterthehacker"
    },
    "body": "It looks like you accidently spelled 'commit' with two 't's."
  }
}

But slack needs this

{
  "message": "baxterthehacker updated issue #2"
}

You can use a relayhook to transform GitHub's webhook into something Slack understands. All you'll need is your incoming slack url and a little bit of mustache to describe the transformation.

Let's say the slack url is this

https://slack.example.com/your-org-name/incoming-webhook

You'll need a mustache template like this to make the payload above

{
  "message": "{{issue.user.login}} updated issue #{{issue.number}}"
}

Once you put all those bits together, you'll get a URL like this

https://api.displace.link/displace?destination=https%3A%2F%2Fslack.example.com%2Fyour-org-name%2Fincoming-webhook&template=%7B%0A%20%20%22message%22%3A%20%22%7B%7Bissue.user.login%7D%7D%20updated%20issue%20%23%7B%7Bissue.number%7D%7D%22%0A%7D

Of course, that's a bit ugly, so head on over to the builder to use our UI to help construct your relayhook url.