How do I make a Discord webhook?

Hi there. I have created a simple Discord webhook that I want to use to send post updates to my Discord server. However, I can’t seem to get it working.

When I try to run a test submission, it fails with the response code 400, which implies that the payload is malformed. I suspect that the webhook format Patreon is using is incompatible with the format Discord expects.

Test Response
---
Status code: 400

Can you please help me with setting up a Discord webhook? I’d like to send a webhook message to one of my Discord server’s channels linking to new posts (and maybe Quips as well). Sometimes I just forget to copy the link to the post and paste it there. Webhooks are built for that purpose.

Edit: I found the resources to create the Discord webhook. The format Discord expects definitely differs from what Patreon sends.

Discord’s format: Webhook Resource - Documentation - Discord
Patreon’s format: API Reference

That doesn’t add up. So I guess I need to actually set up an intermediate app that sets up a custom webhook that scrapes the necessary information and reformats it for Discord. I’ll try to use n8n for that. Any ideas on how do I test it on localhost, before I decide to get a VPS for that?

I’ve got an idea, and set up a mockup webhook endpoint that receives a POST request and logs the body payload so I can look at it. You can test it here: https://test.czghost.cz/test_patreon_webhook.php

It will only receive POST requests, so access from within your browser which by default uses GET requests will fail. You can use stuff like “curl” to test it out. I’ve disabled access to .log files, so you can’t just go and sniff around with it. But if you do actually send some data, it will get logged and you will receive a message back.

However the data I received are a little bit disappointing. Like sure, I can see the contents of the message, but I cannot see the username, cannot see the profile picture URL, and cannot see the campaign page name and profile picture URL. All I get is just the ID reference, and a link to the API call, which doesn’t spit out any results, unless I authorize my requests. However, where do I obtain an API key? I don’t know. This is the example of data it returns:

{
  "data": {
    "attributes": {
      "app_id": null,
      "app_status": null,
      "content": "<p>Ever had a Royale with Cheese in France? Small cultural quirks like that make travel special. Whether it's a burger in Paris or a laid-back meal in Amsterdam, food isn't just about taste-it's about the experience. So sit back, savor, and enjoy the moment.</p>",
      "embed_data": null,
      "embed_url": null,
      "is_paid": false,
      "is_public": false,
      "published_at": "2025-03-02T13:37:00.000+00:00",
      "tiers": [
        196241746
      ],
      "title": "A Royale with Cheese & Other Travel Insights",
      "url": "/posts/royale-with-101316768"
    },
    "id": "101316768",
    "relationships": {
      "campaign": {
        "data": {
          "id": "11410294",
          "type": "campaign"
        },
        "links": {
          "related": "https://www.patreon.com/api/oauth2/v2/campaigns/11410294"
        }
      },
      "user": {
        "data": {
          "id": "108692085",
          "type": "user"
        },
        "links": {
          "related": "https://www.patreon.com/api/oauth2/v2/user/108692085"
        }
      }
    },
    "type": "post"
  },
  "included": [
    {
      "attributes": {},
      "id": "108692085",
      "type": "user"
    },
    {
      "attributes": {},
      "id": "11410294",
      "type": "campaign"
    }
  ],
  "links": {
    "self": "https://www.patreon.com/api/oauth2/v2/posts/101316768"
  }
}

This is what was produced by the Test feature. Love the Pulp Fiction reference, btw. But notice how only the ID and type of the campaign and the associated user is displayed. Not the actual username, not the profile picture URL, which I suspect is under the related links pointing to the OAuth2 API v2 call. However, I can’t access those, without an API key. And I can’t seem to find how to obtain one anywhere.

EDIT: Scratch that, it seems like the webhook API is broken, anyway. It doesn’t include any media, doesn’t include any kind of metadata of a paid post or anything of that sorts, defaults to “false” for both paid and public, doesn’t seem to be influenced by either, and includes all contents, even if it’s paid. I’m not sure if the webhook is worth trying the API key out, to be honest. Might as well just retrieve the URL to the post itself and just post that in my webhook.

EDIT 2: Nevermind, I do need to create a rich embed. But without the data necessary to determine the posted media and where the paid access begins, I guess creating a webhook is not going to be feasible. I’d love to actually see the same embed I see when I post the link myself, an embed automatically added by Discord. But that doesn’t happen for webhook messages.